|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + extends: [ |
| 4 | + 'eslint:recommended', |
| 5 | + ], |
| 6 | + parserOptions: { |
| 7 | + ecmaVersion: 2021, |
| 8 | + sourceType: 'module', |
| 9 | + }, |
| 10 | + rules: { |
| 11 | + 'comma-dangle': ['error', 'always-multiline'], |
| 12 | + indent: ['error', 'tab', { SwitchCase: 1 }], |
| 13 | + 'no-console': 'warn', |
| 14 | + 'no-warning-comments': ['warn', { terms: ['TODO', 'FIXME', 'XXX'], location: 'start' }], |
| 15 | + quotes: ['error', 'single'], |
| 16 | + 'quote-props': ['error', 'as-needed'], |
| 17 | + semi: ['error', 'always'], |
| 18 | + }, |
| 19 | + overrides: [ |
| 20 | + { |
| 21 | + files: ['**/.eslintrc.js', '**/.eslintrc.cjs'], |
| 22 | + env: { |
| 23 | + node: true, |
| 24 | + }, |
| 25 | + parserOptions: { |
| 26 | + ecmaVersion: 'latest', |
| 27 | + sourceType: 'module', |
| 28 | + }, |
| 29 | + }, |
| 30 | + { |
| 31 | + files: ['**/*.ts'], |
| 32 | + plugins: ['@typescript-eslint'], |
| 33 | + parser: '@typescript-eslint/parser', |
| 34 | + extends: ['plugin:@typescript-eslint/recommended'], |
| 35 | + rules: { |
| 36 | + '@typescript-eslint/member-delimiter-style': 'error', |
| 37 | + '@typescript-eslint/no-empty-interface': 'warn', |
| 38 | + '@typescript-eslint/no-explicit-any': 'error', |
| 39 | + 'no-shadow': 'off', |
| 40 | + '@typescript-eslint/no-shadow': 'error', |
| 41 | + semi: 'off', |
| 42 | + '@typescript-eslint/semi': 'error', |
| 43 | + }, |
| 44 | + }, |
| 45 | + { |
| 46 | + files: ['**/*.ts'], |
| 47 | + plugins: ['@typescript-eslint'], |
| 48 | + parser: '@typescript-eslint/parser', |
| 49 | + extends: ['plugin:@typescript-eslint/recommended-requiring-type-checking'], |
| 50 | + rules: { |
| 51 | + '@typescript-eslint/switch-exhaustiveness-check': 'error', |
| 52 | + }, |
| 53 | + parserOptions: { |
| 54 | + tsconfigRootDir: __dirname, |
| 55 | + project: ['./tsconfig.json'], |
| 56 | + }, |
| 57 | + }, |
| 58 | + ], |
| 59 | +}; |
0 commit comments