1+ import { FlatCompat } from '@eslint/eslintrc' ;
12import js from '@eslint/js' ;
3+ import tseslint from '@typescript-eslint/eslint-plugin' ;
4+ import parser from '@typescript-eslint/parser' ;
25import react from 'eslint-plugin-react' ;
36import reactHooks from 'eslint-plugin-react-hooks' ;
4- import { FlatCompat } from '@eslint/eslintrc' ;
5- import parser from '@typescript-eslint/parser' ;
6- import tseslint from '@typescript-eslint/eslint-plugin' ;
77
88const compat = new FlatCompat ( ) ;
99
1010export default [
11+ // Global ignores
12+ {
13+ ignores : [
14+ 'node_modules/**' ,
15+ 'dist/**' ,
16+ 'build/**' ,
17+ 'coverage/**' ,
18+ '*.config.js' ,
19+ '*.config.ts' ,
20+ 'vite.config.ts' ,
21+ 'tailwind.config.ts' ,
22+ 'postcss.ts' ,
23+ ] ,
24+ } ,
25+ // Base configuration
1126 js . configs . recommended ,
1227 ...compat . extends ( 'plugin:react/recommended' ) ,
1328 ...compat . extends ( 'plugin:@typescript-eslint/recommended' ) ,
@@ -21,19 +36,58 @@ export default [
2136 sourceType : 'module' ,
2237 ecmaFeatures : { jsx : true } ,
2338 } ,
39+ globals : {
40+ // Browser globals
41+ window : 'readonly' ,
42+ document : 'readonly' ,
43+ console : 'readonly' ,
44+ setTimeout : 'readonly' ,
45+ clearTimeout : 'readonly' ,
46+ setInterval : 'readonly' ,
47+ clearInterval : 'readonly' ,
48+ localStorage : 'readonly' ,
49+ sessionStorage : 'readonly' ,
50+ fetch : 'readonly' ,
51+ // Node globals (for build tools)
52+ process : 'readonly' ,
53+ Buffer : 'readonly' ,
54+ __dirname : 'readonly' ,
55+ __filename : 'readonly' ,
56+ global : 'readonly' ,
57+ module : 'readonly' ,
58+ require : 'readonly' ,
59+ exports : 'readonly' ,
60+ } ,
2461 } ,
2562 plugins : {
2663 '@typescript-eslint' : tseslint ,
2764 react,
2865 'react-hooks' : reactHooks ,
2966 } ,
3067 rules : {
68+ // React rules
3169 'react/react-in-jsx-scope' : 'off' ,
3270 'react/prop-types' : 'off' ,
71+ 'react/jsx-uses-react' : 'off' ,
72+ 'react/jsx-uses-vars' : 'error' ,
73+
74+ // TypeScript rules
3375 '@typescript-eslint/no-unused-vars' : 'warn' ,
3476 '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
77+ '@typescript-eslint/no-explicit-any' : 'warn' ,
78+ '@typescript-eslint/no-unused-expressions' : 'off' , // Too strict for modern React
79+ '@typescript-eslint/no-non-null-assertion' : 'warn' ,
80+
81+ // React Hooks rules
3582 'react-hooks/rules-of-hooks' : 'error' ,
3683 'react-hooks/exhaustive-deps' : 'warn' ,
84+
85+ // General rules
86+ 'no-undef' : 'off' , // TypeScript handles this
87+ 'no-unused-vars' : 'off' , // Use @typescript -eslint/no-unused-vars instead
88+ 'no-prototype-builtins' : 'warn' ,
89+ 'prefer-const' : 'warn' ,
90+ 'no-var' : 'error' ,
3791 } ,
3892 settings : {
3993 react : {
0 commit comments