|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + env: { |
| 4 | + node: true, |
| 5 | + }, |
| 6 | + parserOptions: { |
| 7 | + parser: '@typescript-eslint/parser', |
| 8 | + }, |
| 9 | + extends: [ |
| 10 | + 'plugin:@typescript-eslint/recommended', |
| 11 | + 'plugin:prettier/recommended', |
| 12 | + 'prettier', |
| 13 | + ], |
| 14 | + plugins: [ |
| 15 | + '@typescript-eslint', |
| 16 | + 'prettier', |
| 17 | + ], |
| 18 | + // add your custom rules here |
| 19 | + rules: { |
| 20 | + semi: ['error', 'always'], |
| 21 | + 'comma-dangle': ['error', 'always-multiline'], |
| 22 | + 'arrow-parens': [ |
| 23 | + 'error', |
| 24 | + 'as-needed', |
| 25 | + { |
| 26 | + requireForBlockBody: false, |
| 27 | + }, |
| 28 | + ], |
| 29 | + 'object-curly-newline': [ |
| 30 | + 'error', |
| 31 | + { |
| 32 | + ObjectExpression: { minProperties: 2, consistent: true }, |
| 33 | + ObjectPattern: { minProperties: 5, consistent: true }, |
| 34 | + ImportDeclaration: { consistent: true }, |
| 35 | + ExportDeclaration: { consistent: true }, |
| 36 | + }, |
| 37 | + ], |
| 38 | + 'no-multiple-empty-lines': [ |
| 39 | + 'error', |
| 40 | + { |
| 41 | + max: 1, |
| 42 | + maxEOF: 0, |
| 43 | + maxBOF: 0, |
| 44 | + }, |
| 45 | + ], |
| 46 | + indent: 'off', |
| 47 | + '@typescript-eslint/indent': 'off', |
| 48 | + '@typescript-eslint/no-explicit-any': 'off', |
| 49 | + '@typescript-eslint/no-inferrable-types': 'off', |
| 50 | + 'no-useless-constructor': 'off', |
| 51 | + '@typescript-eslint/no-useless-constructor': 'off', |
| 52 | + '@typescript-eslint/no-parameter-properties': 'off', |
| 53 | + '@typescript-eslint/consistent-type-assertions': [ |
| 54 | + 'error', |
| 55 | + { |
| 56 | + assertionStyle: 'as', |
| 57 | + objectLiteralTypeAssertions: 'allow-as-parameter', |
| 58 | + }, |
| 59 | + ], |
| 60 | + '@typescript-eslint/no-unused-vars': [ |
| 61 | + 'warn', |
| 62 | + { |
| 63 | + argsIgnorePattern: '^_', |
| 64 | + }, |
| 65 | + ], |
| 66 | + '@typescript-eslint/explicit-function-return-type': [ |
| 67 | + 'warn', |
| 68 | + { |
| 69 | + allowExpressions: true, |
| 70 | + }, |
| 71 | + ], |
| 72 | + }, |
| 73 | + overrides: [ |
| 74 | + { |
| 75 | + files: ['*.js'], |
| 76 | + rules: { |
| 77 | + '@typescript-eslint/no-var-requires': 'off', |
| 78 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 79 | + }, |
| 80 | + }, |
| 81 | + { |
| 82 | + files: ['*.ts'], |
| 83 | + rules: { |
| 84 | + // allow TypeScript method signature overloading, see https://github.com/typescript-eslint/typescript-eslint/issues/291 |
| 85 | + 'no-dupe-class-members': 'off', |
| 86 | + }, |
| 87 | + }, |
| 88 | + ], |
| 89 | +}; |
0 commit comments