|
1 | 1 | module.exports = {
|
2 | 2 | root: true,
|
3 |
| - extends: './node_modules/@textea/dev-kit/config/eslint', |
4 | 3 | settings: {
|
5 | 4 | react: {
|
6 | 5 | version: 'detect'
|
7 | 6 | }
|
8 | 7 | },
|
9 | 8 | env: {
|
10 | 9 | browser: true, es6: true
|
11 |
| - } |
| 10 | + }, |
| 11 | + extends: ['eslint:recommended', 'plugin:react/recommended', 'standard'], |
| 12 | + globals: { |
| 13 | + Atomics: 'readonly', SharedArrayBuffer: 'readonly' |
| 14 | + }, |
| 15 | + parser: '@typescript-eslint/parser', |
| 16 | + parserOptions: { |
| 17 | + ecmaFeatures: { |
| 18 | + globalReturn: false, impliedStrict: true, jsx: true |
| 19 | + }, |
| 20 | + ecmaVersion: 'latest', |
| 21 | + sourceType: 'module' |
| 22 | + }, |
| 23 | + plugins: [ |
| 24 | + 'react', |
| 25 | + 'react-hooks', |
| 26 | + '@typescript-eslint', |
| 27 | + 'simple-import-sort', |
| 28 | + 'import', |
| 29 | + 'unused-imports' |
| 30 | + ], |
| 31 | + rules: { |
| 32 | + eqeqeq: 'error', |
| 33 | + 'no-eval': 'error', |
| 34 | + 'no-var': 'error', |
| 35 | + 'prefer-const': 'error', |
| 36 | + 'sort-imports': 'off', |
| 37 | + 'import/order': 'off', |
| 38 | + 'simple-import-sort/imports': 'error', |
| 39 | + 'simple-import-sort/exports': 'error', |
| 40 | + 'import/first': 'error', |
| 41 | + 'import/newline-after-import': 'error', |
| 42 | + 'import/no-duplicates': 'error', |
| 43 | + 'no-unused-vars': 'off', |
| 44 | + 'unused-imports/no-unused-imports': 'error', |
| 45 | + 'unused-imports/no-unused-vars': [ |
| 46 | + 'warn', { |
| 47 | + vars: 'all', |
| 48 | + varsIgnorePattern: '^_', |
| 49 | + args: 'after-used', |
| 50 | + argsIgnorePattern: '^_' |
| 51 | + }], |
| 52 | + 'no-use-before-define': 'off', |
| 53 | + '@typescript-eslint/no-use-before-define': ['error'], |
| 54 | + 'no-redeclare': 'off', |
| 55 | + '@typescript-eslint/no-redeclare': ['error'], |
| 56 | + 'no-unused-expressions': 'warn', |
| 57 | + 'react/jsx-filename-extension': [ |
| 58 | + 1, { |
| 59 | + extensions: ['.js', '.jsx', '.ts', '.tsx'] |
| 60 | + }], |
| 61 | + 'import/prefer-default-export': 'off', |
| 62 | + 'jsx-quotes': ['error', 'prefer-single'], |
| 63 | + camelcase: 'off', |
| 64 | + 'react/prop-types': 'off', |
| 65 | + 'react/display-name': 'off', |
| 66 | + '@typescript-eslint/no-var-requires': 'off', |
| 67 | + '@typescript-eslint/camelcase': 'off', |
| 68 | + '@typescript-eslint/ban-ts-ignore': 'off', |
| 69 | + '@typescript-eslint/member-delimiter-style': [ |
| 70 | + 'error', { |
| 71 | + multiline: { |
| 72 | + delimiter: 'none', requireLast: true |
| 73 | + }, |
| 74 | + singleline: { |
| 75 | + delimiter: 'semi', requireLast: false |
| 76 | + } |
| 77 | + }], |
| 78 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 79 | + 'react-hooks/rules-of-hooks': 'error', |
| 80 | + 'react-hooks/exhaustive-deps': 'warn', |
| 81 | + 'no-restricted-imports': 'off', |
| 82 | + '@typescript-eslint/no-restricted-imports': [ |
| 83 | + 'error', |
| 84 | + { |
| 85 | + patterns: [ |
| 86 | + { |
| 87 | + group: ['**/dist'], |
| 88 | + message: 'Don\'t import from dist', |
| 89 | + allowTypeImports: false |
| 90 | + } |
| 91 | + ] |
| 92 | + } |
| 93 | + ] |
| 94 | + }, |
| 95 | + overrides: [ |
| 96 | + { |
| 97 | + files: ['*.d.ts'], |
| 98 | + rules: { |
| 99 | + 'no-undef': 'off' |
| 100 | + } |
| 101 | + }, |
| 102 | + { |
| 103 | + files: ['*.test.ts', '*.test.tsx'], env: { jest: true } |
| 104 | + } |
| 105 | + ] |
12 | 106 | }
|
0 commit comments