From 8fdf546df5b5345b96ce21109ab7ab56de769412 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Tue, 13 Feb 2024 08:01:57 -0800 Subject: [PATCH] WIP use eslint flat config --- eslint.config.mjs | 23 +++++++++++++++++++++++ package.json | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 eslint.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..9cb6c60ef --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,23 @@ +// @ts-check + +import eslint from "@eslint/js"; +import tseslint from "typescript-eslint"; + +export default tseslint.config({ + plugins: { + "@typescript-eslint": tseslint.plugin, + }, + languageOptions: { + parser: tseslint.parser, + parserOptions: { + project: true, + }, + }, + rules: { + "@typescript-eslint/no-unsafe-argument": "error", + "@typescript-eslint/no-unsafe-assignment": "error", + "@typescript-eslint/no-unsafe-call": "error", + "@typescript-eslint/no-unsafe-member-access": "error", + "@typescript-eslint/no-unsafe-return": "error", + }, +}); diff --git a/package.json b/package.json index ad9b3aad8..b40944f5d 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "scripts": { "build": "tsc", - "lint": "ESLINT_USE_FLAT_CONFIG=true eslint 'src/**/*.ts'", + "lint": "ESLINT_USE_FLAT_CONFIG=true eslint 'src/**/*.ts' -c eslint.config.mjs", "release": "yarn build && changeset publish", "test": "vitest" },