|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +/** @type {import('eslint').Linter.Config} */ |
| 4 | +const config = { |
| 5 | + root: true, |
| 6 | + parser: "@typescript-eslint/parser", |
| 7 | + plugins: ["@typescript-eslint", "compat", "import"], |
| 8 | + extends: [ |
| 9 | + "plugin:@typescript-eslint/eslint-recommended", |
| 10 | + "plugin:@typescript-eslint/recommended", |
| 11 | + "plugin:compat/recommended", |
| 12 | + "plugin:import/recommended", |
| 13 | + "plugin:import/typescript", |
| 14 | + "prettier", |
| 15 | + ], |
| 16 | + env: { |
| 17 | + browser: true, |
| 18 | + es2020: true, |
| 19 | + }, |
| 20 | + parserOptions: { |
| 21 | + tsconfigRootDir: __dirname, |
| 22 | + project: "./tsconfig.json", |
| 23 | + sourceType: "module", |
| 24 | + ecmaVersion: 2020, |
| 25 | + }, |
| 26 | + settings: { |
| 27 | + "import/parsers": { |
| 28 | + "@typescript-eslint/parser": [".ts", ".tsx"], |
| 29 | + }, |
| 30 | + "import/resolver": { |
| 31 | + typescript: true, |
| 32 | + }, |
| 33 | + react: { |
| 34 | + version: "detect", |
| 35 | + }, |
| 36 | + }, |
| 37 | + rules: { |
| 38 | + "@typescript-eslint/ban-types": "off", |
| 39 | + "@typescript-eslint/ban-ts-comment": "off", |
| 40 | + "@typescript-eslint/consistent-type-imports": "error", |
| 41 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 42 | + "@typescript-eslint/no-empty-interface": "off", |
| 43 | + "@typescript-eslint/no-explicit-any": "off", |
| 44 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 45 | + "@typescript-eslint/no-unnecessary-condition": "error", |
| 46 | + "@typescript-eslint/no-inferrable-types": [ |
| 47 | + "error", |
| 48 | + { |
| 49 | + ignoreParameters: true, |
| 50 | + }, |
| 51 | + ], |
| 52 | + "no-shadow": "error", |
| 53 | + "import/no-cycle": "error", |
| 54 | + "import/no-unresolved": ["error", { ignore: ["^@tanstack/"] }], |
| 55 | + "import/no-unused-modules": ["off", { unusedExports: true }], |
| 56 | + "no-redeclare": "off", |
| 57 | + }, |
| 58 | + overrides: [ |
| 59 | + { |
| 60 | + files: ["**/*.test.{ts,tsx}"], |
| 61 | + rules: { |
| 62 | + "@typescript-eslint/no-unnecessary-condition": "off", |
| 63 | + }, |
| 64 | + }, |
| 65 | + ], |
| 66 | +}; |
| 67 | + |
| 68 | +module.exports = config; |
0 commit comments