|
15 | 15 | */
|
16 | 16 |
|
17 | 17 | module.exports = {
|
18 |
| - parser: '@typescript-eslint/parser', |
19 |
| - plugins: ['@typescript-eslint', 'react', 'prettier'], |
20 |
| - env: { |
21 |
| - browser: true, |
22 |
| - es2021: true, |
23 |
| - }, |
24 |
| - parserOptions: { |
25 |
| - ecmaVersion: 2021, |
26 |
| - sourceType: 'module', |
27 |
| - ecmaFeatures: { |
28 |
| - jsx: true, |
29 |
| - }, |
30 |
| - project: ['./tsconfig.json'], |
31 |
| - }, |
32 |
| - globals: { |
33 |
| - JSX: true, |
34 |
| - }, |
35 |
| - extends: [ |
36 |
| - 'eslint:recommended', |
37 |
| - 'plugin:react/recommended', |
38 |
| - 'plugin:react/jsx-runtime', |
39 |
| - 'plugin:@typescript-eslint/eslint-recommended', |
40 |
| - 'airbnb', |
41 |
| - 'airbnb/hooks', |
42 |
| - 'prettier', |
43 |
| - ], |
44 |
| - rules: { |
45 |
| - 'prettier/prettier': ['error'], |
46 |
| - 'linebreak-style': ['error', 'unix'], |
47 |
| - 'no-console': 'warn', |
48 |
| - 'no-var': 'error', |
49 |
| - 'no-duplicate-imports': 'error', |
50 |
| - 'no-shadow': 'off', |
51 |
| - '@typescript-eslint/no-shadow': 'warn', |
52 |
| - '@typescript-eslint/explicit-function-return-type': 'off', |
53 |
| - '@typescript-eslint/explicit-member-accessibility': 'off', |
54 |
| - // Since we are using typescript, we can disable the no-unused-vars rule for enum,etc |
55 |
| - 'no-unused-vars': 'off', |
56 |
| - '@typescript-eslint/no-unused-vars': 'error', |
57 |
| - 'react/jsx-filename-extension': [ |
58 |
| - 'error', |
59 |
| - { |
60 |
| - extensions: ['tsx'], |
61 |
| - }, |
62 |
| - ], |
63 |
| - 'react/jsx-props-no-spreading': 'off', |
64 |
| - 'react/prefer-stateless-function': 'off', |
65 |
| - 'jsx-a11y/click-events-have-key-events': 'off', |
66 |
| - 'jsx-a11y/no-static-element-interactions': 'off', |
67 |
| - 'jsx-a11y/no-noninteractive-element-interactions': 'off', |
68 |
| - 'no-underscore-dangle': 'off', |
69 |
| - 'import/no-extraneous-dependencies': [ |
70 |
| - 'warn', |
71 |
| - { |
72 |
| - devDependencies: true, |
73 |
| - }, |
74 |
| - ], |
75 |
| - 'no-plusplus': [ |
76 |
| - 'error', |
77 |
| - { |
78 |
| - allowForLoopAfterthoughts: true, |
79 |
| - }, |
80 |
| - ], |
81 |
| - // Since we dont use prop-types, we can disable this rule |
82 |
| - 'react/require-default-props': 'off', |
83 |
| - 'react-hooks/exhaustive-deps': 'off', |
84 |
| - 'react/function-component-definition': [ |
85 |
| - 'warn', |
86 |
| - { |
87 |
| - namedComponents: 'arrow-function', |
88 |
| - unnamedComponents: 'arrow-function', |
89 |
| - }, |
90 |
| - ], |
91 |
| - 'react/jsx-uses-react': 'off', |
92 |
| - 'react/react-in-jsx-scope': 'off', |
93 |
| - // additional rules: |
94 |
| - '@typescript-eslint/no-floating-promises': 'error', |
95 |
| - 'import/prefer-default-export': 'off', |
96 |
| - 'import/extensions': [ |
97 |
| - 'warn', |
98 |
| - 'ignorePackages', |
99 |
| - { |
100 |
| - js: 'never', |
101 |
| - jsx: 'never', |
102 |
| - ts: 'never', |
103 |
| - tsx: 'never', |
104 |
| - }, |
105 |
| - ], |
106 |
| - 'no-restricted-exports': 'off', |
107 |
| - }, |
108 |
| - overrides: [ |
109 |
| - { |
110 |
| - files: ['*.ts', '*.tsx'], |
111 |
| - rules: { |
112 |
| - 'no-undef': 'off', |
113 |
| - }, |
114 |
| - }, |
115 |
| - ], |
116 |
| - settings: { |
117 |
| - react: { |
118 |
| - version: 'detect', |
119 |
| - }, |
120 |
| - 'import/resolver': { |
121 |
| - node: { |
122 |
| - moduleDirectory: ['src', 'node_modules'], |
123 |
| - extensions: ['.js', '.jsx', '.ts', '.tsx'], |
124 |
| - }, |
125 |
| - }, |
126 |
| - }, |
127 |
| - ignorePatterns: [".eslintrc.cjs", "vite.config.ts"], |
| 18 | + parser: '@typescript-eslint/parser', |
| 19 | + plugins: ['@typescript-eslint', 'react', 'prettier', 'import'], |
| 20 | + env: { |
| 21 | + browser: true, |
| 22 | + es2021: true, |
| 23 | + }, |
| 24 | + parserOptions: { |
| 25 | + ecmaVersion: 2021, |
| 26 | + sourceType: 'module', |
| 27 | + ecmaFeatures: { |
| 28 | + jsx: true, |
| 29 | + }, |
| 30 | + project: ['./tsconfig.json'], |
| 31 | + }, |
| 32 | + globals: { |
| 33 | + JSX: true, |
| 34 | + }, |
| 35 | + extends: [ |
| 36 | + 'eslint:recommended', |
| 37 | + 'plugin:react/recommended', |
| 38 | + 'plugin:react/jsx-runtime', |
| 39 | + 'plugin:@typescript-eslint/eslint-recommended', |
| 40 | + 'airbnb', |
| 41 | + 'airbnb/hooks', |
| 42 | + 'prettier', |
| 43 | + ], |
| 44 | + rules: { |
| 45 | + 'prettier/prettier': ['error'], |
| 46 | + 'linebreak-style': ['error', 'unix'], |
| 47 | + 'no-console': 'warn', |
| 48 | + 'no-var': 'error', |
| 49 | + 'no-duplicate-imports': 'error', |
| 50 | + 'no-shadow': 'off', |
| 51 | + '@typescript-eslint/no-shadow': 'warn', |
| 52 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 53 | + '@typescript-eslint/explicit-member-accessibility': 'off', |
| 54 | + // Since we are using typescript, we can disable the no-unused-vars rule for enum,etc |
| 55 | + 'no-unused-vars': 'off', |
| 56 | + '@typescript-eslint/no-unused-vars': 'error', |
| 57 | + 'react/jsx-filename-extension': [ |
| 58 | + 'error', |
| 59 | + { |
| 60 | + extensions: ['tsx'], |
| 61 | + }, |
| 62 | + ], |
| 63 | + 'react/jsx-props-no-spreading': 'off', |
| 64 | + 'react/prefer-stateless-function': 'off', |
| 65 | + 'jsx-a11y/click-events-have-key-events': 'off', |
| 66 | + 'jsx-a11y/no-static-element-interactions': 'off', |
| 67 | + 'jsx-a11y/no-noninteractive-element-interactions': 'off', |
| 68 | + 'no-underscore-dangle': 'off', |
| 69 | + 'import/no-extraneous-dependencies': [ |
| 70 | + 'warn', |
| 71 | + { |
| 72 | + devDependencies: true, |
| 73 | + }, |
| 74 | + ], |
| 75 | + 'import/no-named-as-default-member': 'off', |
| 76 | + 'no-plusplus': [ |
| 77 | + 'error', |
| 78 | + { |
| 79 | + allowForLoopAfterthoughts: true, |
| 80 | + }, |
| 81 | + ], |
| 82 | + // Since we dont use prop-types, we can disable this rule |
| 83 | + 'react/require-default-props': 'off', |
| 84 | + 'react-hooks/exhaustive-deps': 'off', |
| 85 | + 'react/function-component-definition': [ |
| 86 | + 'warn', |
| 87 | + { |
| 88 | + namedComponents: 'arrow-function', |
| 89 | + unnamedComponents: 'arrow-function', |
| 90 | + }, |
| 91 | + ], |
| 92 | + 'react/jsx-uses-react': 'off', |
| 93 | + 'react/react-in-jsx-scope': 'off', |
| 94 | + // additional rules: |
| 95 | + '@typescript-eslint/no-floating-promises': 'error', |
| 96 | + 'import/prefer-default-export': 'off', |
| 97 | + 'import/extensions': [ |
| 98 | + 'warn', |
| 99 | + 'ignorePackages', |
| 100 | + { |
| 101 | + js: 'never', |
| 102 | + jsx: 'never', |
| 103 | + ts: 'never', |
| 104 | + tsx: 'never', |
| 105 | + }, |
| 106 | + ], |
| 107 | + // Re-add this while resolving ESLint issues |
| 108 | + 'import/no-cycle': 'off', |
| 109 | + 'import/prefer-default-export': 'off', |
| 110 | + 'no-restricted-exports': 'off', |
| 111 | + 'import/named': 'off' |
| 112 | + }, |
| 113 | + overrides: [ |
| 114 | + { |
| 115 | + files: ['*.ts', '*.tsx'], |
| 116 | + rules: { |
| 117 | + 'no-undef': 'off', |
| 118 | + }, |
| 119 | + }, |
| 120 | + ], |
| 121 | + settings: { |
| 122 | + react: { |
| 123 | + version: 'detect', |
| 124 | + }, |
| 125 | + 'import/parsers': { |
| 126 | + '@typescript-eslint/parser': ['.ts', '.tsx'], |
| 127 | + }, |
| 128 | + 'import/resolver': { |
| 129 | + typescript: { |
| 130 | + alwaysTryTypes: true, |
| 131 | + }, |
| 132 | + node: { |
| 133 | + moduleDirectory: ['src', 'node_modules'], |
| 134 | + extensions: ['.js', '.jsx', '.ts', '.tsx'], |
| 135 | + }, |
| 136 | + }, |
| 137 | + 'import/ignore': ['\\.png$', '\\.jpg$', '\\.svg$'], |
| 138 | + }, |
| 139 | + ignorePatterns: ['.eslintrc.cjs', 'vite.config.ts'], |
128 | 140 | }
|
0 commit comments