|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + es2021: true, |
| 4 | + node: true, |
| 5 | + }, |
| 6 | + extends: ['eslint:recommended', 'prettier'], |
| 7 | + overrides: [], |
| 8 | + parserOptions: { |
| 9 | + ecmaVersion: 'latest', |
| 10 | + sourceType: 'module', |
| 11 | + }, |
| 12 | + rules: { |
| 13 | + // overrides |
| 14 | + 'no-unused-vars': ['error', { ignoreRestSiblings: true }], |
| 15 | + |
| 16 | + // important |
| 17 | + 'no-shadow': 'error', |
| 18 | + |
| 19 | + // possible errors |
| 20 | + eqeqeq: 'error', |
| 21 | + 'no-constant-binary-expression': 'error', |
| 22 | + 'no-duplicate-imports': 'error', |
| 23 | + 'no-return-assign': 'error', |
| 24 | + 'no-sequences': 'error', |
| 25 | + |
| 26 | + // preference/style |
| 27 | + 'no-else-return': 'error', |
| 28 | + 'no-return-await': 'error', |
| 29 | + 'no-var': 'error', |
| 30 | + 'require-await': 'error', |
| 31 | + 'spaced-comment': ['error', 'always'], |
| 32 | + |
| 33 | + // not needed with typescript checking, copied from https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts |
| 34 | + // (this repo currently doesn't use typescript-eslint) |
| 35 | + 'constructor-super': 'off', // ts(2335) & ts(2377) |
| 36 | + 'getter-return': 'off', // ts(2378) |
| 37 | + 'no-const-assign': 'off', // ts(2588) |
| 38 | + 'no-dupe-args': 'off', // ts(2300) |
| 39 | + 'no-dupe-class-members': 'off', // ts(2393) & ts(2300) |
| 40 | + 'no-dupe-keys': 'off', // ts(1117) |
| 41 | + 'no-func-assign': 'off', // ts(2539) |
| 42 | + 'no-import-assign': 'off', // ts(2539) & ts(2540) |
| 43 | + 'no-new-symbol': 'off', // ts(7009) |
| 44 | + 'no-obj-calls': 'off', // ts(2349) |
| 45 | + 'no-redeclare': 'off', // ts(2451) |
| 46 | + 'no-setter-return': 'off', // ts(2408) |
| 47 | + 'no-this-before-super': 'off', // ts(2376) |
| 48 | + 'no-undef': 'off', // ts(2304) |
| 49 | + 'no-unreachable': 'off', // ts(7027) |
| 50 | + 'no-unsafe-negation': 'off', // ts(2365) & ts(2360) & ts(2358) |
| 51 | + 'valid-typeof': 'off', // ts(2367) |
| 52 | + }, |
| 53 | +}; |
0 commit comments