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