Skip to content

Commit eb229ff

Browse files
committed
fix: refactor ESLint configuration for improved clarity and consistency
1 parent 6b24dc7 commit eb229ff

File tree

1 file changed

+22
-40
lines changed

1 file changed

+22
-40
lines changed

eslint.config.js

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,46 @@ import js from '@eslint/js';
22
import globals from 'globals';
33
import reactHooks from 'eslint-plugin-react-hooks';
44
import reactRefresh from 'eslint-plugin-react-refresh';
5-
import tseslint from '@typescript-eslint/eslint-plugin';
6-
import tsparser from '@typescript-eslint/parser';
5+
import tsPlugin from '@typescript-eslint/eslint-plugin';
6+
import tsParser from '@typescript-eslint/parser';
77

88
export default [
9+
{ ignores: ['dist/**'] },
910
{
10-
ignores: ['dist/**'],
11-
},
12-
js.configs.recommended,
13-
{
14-
files: ['**/*.{ts,tsx}'],
11+
files: ['**/*.{ts,tsx,js,jsx}'],
1512
languageOptions: {
16-
ecmaVersion: 2020,
17-
globals: {
18-
...globals.browser,
19-
JSX: 'readonly',
20-
process: 'readonly',
21-
},
22-
parser: tsparser,
23-
parserOptions: {
24-
ecmaVersion: 'latest',
25-
sourceType: 'module',
26-
jsx: true,
27-
},
13+
parser: tsParser,
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
16+
globals: globals.browser,
2817
},
2918
plugins: {
30-
'@typescript-eslint': tseslint,
19+
'@typescript-eslint': tsPlugin,
3120
'react-hooks': reactHooks,
3221
'react-refresh': reactRefresh,
3322
},
3423
rules: {
35-
...tseslint.configs.recommended.rules,
24+
...js.configs.recommended.rules,
25+
...tsPlugin.configs.recommended.rules,
3626
...reactHooks.configs.recommended.rules,
3727
curly: ['error', 'all'],
38-
'react-refresh/only-export-components': [
39-
'warn',
40-
{ allowConstantExport: true },
41-
],
28+
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
4229
},
4330
},
4431
{
45-
files: ['vite.config.ts', 'vite.config.js', 'eslint.config.js', '*.config.ts', '*.config.js'],
32+
files: [
33+
'**/*.config.{js,ts}',
34+
'vite.config.{js,ts}',
35+
'eslint.config.js',
36+
'tailwind.config.{js,ts}',
37+
],
4638
languageOptions: {
47-
ecmaVersion: 2020,
48-
globals: {
49-
...globals.node,
50-
...globals.browser,
51-
},
52-
parser: tsparser,
53-
parserOptions: {
54-
ecmaVersion: 'latest',
55-
sourceType: 'module',
56-
},
57-
},
58-
plugins: {
59-
'@typescript-eslint': tseslint,
39+
parser: tsParser,
40+
ecmaVersion: 'latest',
41+
sourceType: 'module',
42+
globals: { ...globals.node },
6043
},
6144
rules: {
62-
...tseslint.configs.recommended.rules,
6345
curly: ['error', 'all'],
6446
},
6547
},

0 commit comments

Comments
 (0)