|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + plugins: ['@typescript-eslint'], |
| 4 | + parser: '@typescript-eslint/parser', |
| 5 | + overrides: [ |
| 6 | + { |
| 7 | + files: ['*.ts', '*.tsx'], // Your TypeScript files extension |
| 8 | + // As mentioned in the comments, you should extend TypeScript plugins here, |
| 9 | + // instead of extending them outside the `overrides`. |
| 10 | + // If you don't want to extend any rules, you don't need an `extends` attribute. |
| 11 | + extends: [ |
| 12 | + 'plugin:@typescript-eslint/recommended', |
| 13 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 14 | + ], |
| 15 | + parserOptions: { |
| 16 | + project: ['./tsconfig.json'], // Specify it only for TypeScript files |
| 17 | + tsconfigRootDir: __dirname, |
| 18 | + projectFolderIgnoreList: ['**/node_modules/**', '**/dist/**', '**/scripts/**'], |
| 19 | + }, |
| 20 | + rules: { |
| 21 | + // Enabled: typescript |
| 22 | + 'no-param-reassign': ['error'], |
| 23 | + '@typescript-eslint/await-thenable': 'error', |
| 24 | + '@typescript-eslint/dot-notation': 'error', |
| 25 | + '@typescript-eslint/no-unused-vars': 'off', |
| 26 | + '@typescript-eslint/no-unused-expressions': 'error', |
| 27 | + '@typescript-eslint/no-var-requires': 'error', |
| 28 | + '@typescript-eslint/prefer-namespace-keyword': 'error', |
| 29 | + '@typescript-eslint/no-floating-promises': 'off', |
| 30 | + '@typescript-eslint/no-inferrable-types': 'off', |
| 31 | + '@typescript-eslint/promise-function-async': 'off', |
| 32 | + '@typescript-eslint/no-use-before-define': 'off', |
| 33 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 34 | + '@typescript-eslint/ban-types': 'off', |
| 35 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 36 | + '@typescript-eslint/no-unsafe-member-access': 'warn', |
| 37 | + // Enabled: eslint |
| 38 | + 'default-case': 'error', |
| 39 | + 'no-return-await': 'error', |
| 40 | + eqeqeq: ['error', 'smart'], |
| 41 | + 'id-denylist': ['error', 'any', 'Undefined', 'undefined'], |
| 42 | + 'id-match': 'error', |
| 43 | + 'no-caller': 'error', |
| 44 | + 'no-cond-assign': 'error', |
| 45 | + 'no-invalid-this': 'error', |
| 46 | + 'no-debugger': 'error', |
| 47 | + 'no-eval': 'error', |
| 48 | + 'no-new-wrappers': 'error', |
| 49 | + 'no-redeclare': 'error', |
| 50 | + 'prefer-const': 'error', |
| 51 | + 'prefer-object-spread': 'error', |
| 52 | + radix: 'error', |
| 53 | + 'sort-imports': [ |
| 54 | + 'error', |
| 55 | + { |
| 56 | + ignoreCase: true, |
| 57 | + ignoreDeclarationSort: true, |
| 58 | + }, |
| 59 | + ], |
| 60 | + // Disabled: eslint |
| 61 | + 'guard-for-in': 'off', |
| 62 | + 'no-empty': 'off', |
| 63 | + 'no-magic-numbers': 'off', |
| 64 | + 'no-null/no-null': 'off', |
| 65 | + 'no-shadow': 'off', |
| 66 | + 'no-trailing-spaces': 'off', |
| 67 | + 'no-underscore-dangle': 'off', |
| 68 | + 'no-var': 'off', |
| 69 | + 'no-unused-vars': 'off', |
| 70 | + 'no-case-declarations': 'off', |
| 71 | + 'no-constant-condition': 'off', |
| 72 | + 'no-dupe-class-members': 'off', |
| 73 | + }, |
| 74 | + }, |
| 75 | + ], |
| 76 | +}; |
| 77 | + |
0 commit comments