|
| 1 | +const { builtinModules } = require('node:module'); |
| 2 | + |
1 | 3 | module.exports = {
|
2 | 4 | root: true,
|
3 |
| - parserOptions: { |
4 |
| - ecmaVersion: 2020, |
5 |
| - ecmaFeatures: { |
6 |
| - jsx: true, |
7 |
| - }, |
8 |
| - project: './tsconfig.json', |
9 |
| - }, |
10 | 5 | env: {
|
11 | 6 | browser: true,
|
12 | 7 | node: true,
|
13 |
| - jest: true, |
14 | 8 | es6: true,
|
15 | 9 | },
|
16 |
| - parser: '@typescript-eslint/parser', |
17 |
| - plugins: ['@typescript-eslint', 'import'], |
| 10 | + |
18 | 11 | extends: [
|
19 |
| - 'airbnb-typescript/base', |
| 12 | + 'eslint:recommended', |
| 13 | + 'plugin:@typescript-eslint/recommended', |
| 14 | + 'prettier', |
20 | 15 | ],
|
| 16 | + plugins: ['import'], |
| 17 | + parser: '@typescript-eslint/parser', |
| 18 | + parserOptions: { |
| 19 | + sourceType: 'module', |
| 20 | + ecmaFeatures: { |
| 21 | + jsx: true, |
| 22 | + }, |
| 23 | + }, |
21 | 24 | rules: {
|
22 |
| - 'no-nested-ternary': [0], |
23 |
| - 'no-param-reassign': [0], |
24 |
| - 'no-use-before-define': [0], |
25 |
| - 'no-restricted-syntax': [0], |
26 |
| - 'no-plusplus': [0], |
27 |
| - 'import/no-extraneous-dependencies': [0], |
28 |
| - 'consistent-return': [0], |
29 |
| - 'no-bitwise': [0], |
30 |
| - '@typescript-eslint/no-use-before-define': [0], |
31 |
| - 'prefer-destructuring': [2, { array: false }], |
32 |
| - 'max-len': [0], |
| 25 | + eqeqeq: ['warn', 'always', { null: 'never' }], |
| 26 | + 'no-debugger': ['error'], |
| 27 | + 'no-empty': ['warn', { allowEmptyCatch: true }], |
| 28 | + 'prefer-const': [ |
| 29 | + 'warn', |
| 30 | + { |
| 31 | + destructuring: 'all', |
| 32 | + }, |
| 33 | + ], |
| 34 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 35 | + '@typescript-eslint/no-var-requires': 'off', |
| 36 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 37 | + '@typescript-eslint/no-explicit-any': 'off', |
| 38 | + '@typescript-eslint/consistent-type-imports': [ |
| 39 | + 'error', |
| 40 | + { prefer: 'type-imports', fixStyle: 'inline-type-imports' }, |
| 41 | + ], |
| 42 | + |
| 43 | + 'import/no-nodejs-modules': [ |
| 44 | + 'error', |
| 45 | + { allow: builtinModules.map((mod) => `node:${mod}`) }, |
| 46 | + ], |
| 47 | + 'import/no-duplicates': 'error', |
| 48 | + 'import/order': 'error', |
| 49 | + 'sort-imports': [ |
| 50 | + 'error', |
| 51 | + { |
| 52 | + ignoreCase: false, |
| 53 | + ignoreDeclarationSort: true, |
| 54 | + ignoreMemberSort: false, |
| 55 | + memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], |
| 56 | + allowSeparatedGroups: false, |
| 57 | + }, |
| 58 | + ], |
33 | 59 | },
|
34 | 60 | };
|
0 commit comments