|
1 | 1 | module.exports = { |
2 | | - 'env': { |
3 | | - 'es6': true, |
4 | | - 'jest': true, |
5 | | - 'node': true, |
6 | | - 'browser': true |
7 | | - }, |
8 | | - 'extends': [ |
9 | | - 'eslint:recommended', |
10 | | - 'plugin:react/recommended', |
11 | | - 'plugin:import/errors', |
12 | | - 'plugin:import/warnings', |
13 | | - // 'plugin:react-hooks' |
14 | | - ], |
15 | | - 'parserOptions': { |
16 | | - 'ecmaVersion': 2018, |
17 | | - 'sourceType': 'module' |
18 | | - }, |
19 | | - 'settings': { |
20 | | - 'react': { |
21 | | - 'version': '16.8.0' |
22 | | - }, |
23 | | - }, |
24 | | - 'rules': { |
25 | | - 'indent': [ |
26 | | - 'off', |
27 | | - 'tab' |
28 | | - ], |
29 | | - 'quotes': [ |
30 | | - 'error', |
31 | | - 'single' |
32 | | - ], |
33 | | - 'semi': [ |
34 | | - 'error', |
35 | | - 'always' |
36 | | - ], |
37 | | - 'eqeqeq': [ |
38 | | - 'error', |
39 | | - 'always' |
40 | | - ], |
41 | | - 'no-trailing-spaces': ['error', { 'ignoreComments': true }], |
42 | | - 'consistent-this': 2, |
43 | | - 'import/no-self-import': 2, |
44 | | - 'import/no-internal-modules': 0, |
45 | | - 'import/no-dynamic-require': 0, |
46 | | - 'import/no-useless-path-segments': 2, |
47 | | - 'import/order': 1, |
48 | | - 'import/newline-after-import': 2, |
49 | | - // "react-hooks/rules-of-hooks": "error", |
50 | | - // "react-hooks/exhaustive-deps": "warn" |
51 | | - } |
| 2 | + root: true, |
| 3 | + env: { |
| 4 | + browser: true, |
| 5 | + es2021: true, |
| 6 | + node: true, |
| 7 | + }, |
| 8 | + extends: [ |
| 9 | + 'eslint:recommended', |
| 10 | + 'plugin:react/recommended', |
| 11 | + 'plugin:react-hooks/recommended', |
| 12 | + 'plugin:import/recommended', |
| 13 | + 'plugin:import/typescript', |
| 14 | + 'plugin:@typescript-eslint/recommended', |
| 15 | + ], |
| 16 | + parser: '@typescript-eslint/parser', |
| 17 | + parserOptions: { |
| 18 | + ecmaFeatures: { |
| 19 | + jsx: true, |
| 20 | + }, |
| 21 | + ecmaVersion: 'latest', |
| 22 | + sourceType: 'module', |
| 23 | + }, |
| 24 | + plugins: ['react', 'react-hooks', 'import', '@typescript-eslint'], |
| 25 | + rules: { |
| 26 | + 'react/react-in-jsx-scope': 'off', |
| 27 | + 'react/prop-types': 'off', |
| 28 | + 'react-hooks/rules-of-hooks': 'error', |
| 29 | + 'react-hooks/exhaustive-deps': 'warn', |
| 30 | + 'import/order': [ |
| 31 | + 'error', |
| 32 | + { |
| 33 | + groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], |
| 34 | + alphabetize: { order: 'asc', caseInsensitive: true }, |
| 35 | + }, |
| 36 | + ], |
| 37 | + '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], |
| 38 | + '@typescript-eslint/no-explicit-any': 'warn', |
| 39 | + }, |
| 40 | + settings: { |
| 41 | + react: { |
| 42 | + version: 'detect', |
| 43 | + }, |
| 44 | + 'import/resolver': { |
| 45 | + node: { |
| 46 | + extensions: ['.js', '.jsx', '.ts', '.tsx'], |
| 47 | + }, |
| 48 | + }, |
| 49 | + }, |
52 | 50 | }; |
0 commit comments