2
2
/* eslint-disable no-underscore-dangle */
3
3
/* eslint-disable import/no-anonymous-default-export */
4
4
5
- // Node.js path and URL utilities
6
- import path from 'node:path' ;
7
- import { fileURLToPath } from 'node:url' ;
8
-
9
5
// ESLint core and compatibility utilities
10
6
import js from '@eslint/js' ;
11
7
import { FlatCompat } from '@eslint/eslintrc' ;
12
- import { fixupPluginRules } from '@eslint/compat' ;
8
+ // import { fixupPluginRules } from '@eslint/compat';
13
9
import globals from 'globals' ;
14
10
15
11
// ESLint plugins for various technologies and best practices
@@ -26,15 +22,12 @@ import prettier from 'eslint-plugin-prettier';
26
22
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' ;
27
23
import testingLibrary from 'eslint-plugin-testing-library' ;
28
24
import vitest from 'eslint-plugin-vitest' ;
29
- import deprecationPlugin from 'eslint-plugin-deprecation' ;
25
+ import deprecation from 'eslint-plugin-deprecation' ;
30
26
// import nextPlugin from '@next/eslint-plugin-next';
31
27
import pluginQuery from '@tanstack/eslint-plugin-query' ;
32
28
33
- // Resolve current file and directory paths
34
- const __filename = fileURLToPath ( import . meta. url ) ;
35
- const __dirname = path . dirname ( __filename ) ;
36
29
const compat = new FlatCompat ( {
37
- baseDirectory : __dirname ,
30
+ baseDirectory : import . meta . dirname , // Added in: v21.2.0, v20.11.0 @ https://nodejs.org/api/esm.html#importmetadirname
38
31
recommendedConfig : js . configs . recommended ,
39
32
allConfig : js . configs . all ,
40
33
} ) ;
@@ -72,7 +65,8 @@ export default [
72
65
// '@next/next': nextPlugin,
73
66
'unused-imports' : unusedImports ,
74
67
'@tanstack/query' : pluginQuery ,
75
- deprecation : fixupPluginRules ( deprecationPlugin ) ,
68
+ // deprecation: fixupPluginRules(deprecationPlugin),
69
+ deprecation,
76
70
tailwindcss,
77
71
tsdoc,
78
72
import : _import ,
@@ -118,6 +112,8 @@ export default [
118
112
unnamedComponents : 'arrow-function' ,
119
113
} ,
120
114
] ,
115
+ // Performance and optimization rules
116
+ 'react/jsx-no-useless-fragment' : 'error' ,
121
117
122
118
// Accessibility rules
123
119
'jsx-a11y/anchor-is-valid' : 'off' ,
@@ -153,12 +149,16 @@ export default [
153
149
} ,
154
150
] ,
155
151
'import/prefer-default-export' : 'off' ,
152
+ 'import/no-duplicates' : 'error' ,
156
153
157
154
// TypeScript rules
158
155
'@typescript-eslint/comma-dangle' : 'off' ,
159
156
'@typescript-eslint/consistent-type-imports' : 'error' ,
160
157
'@typescript-eslint/no-unnecessary-condition' : 'error' ,
158
+ // '@typescript-eslint/strict-boolean-expressions': 'error',
159
+ '@typescript-eslint/no-explicit-any' : 'error' ,
161
160
'@typescript-eslint/no-unused-vars' : 'off' ,
161
+ '@typescript-eslint/prefer-optional-chain' : 'error' ,
162
162
163
163
// Unused imports/variables rules
164
164
'unused-imports/no-unused-imports' : 'error' ,
@@ -168,6 +168,7 @@ export default [
168
168
'no-underscore-dangle' : 'off' ,
169
169
'tailwindcss/no-custom-classname' : 'off' ,
170
170
'tsdoc/syntax' : 'warn' ,
171
+ 'no-console' : [ 'warn' , { allow : [ 'warn' , 'error' ] } ] ,
171
172
} ,
172
173
} ,
173
174
0 commit comments