Skip to content

Commit 9c5f895

Browse files
MohsinHashmi-DataInnmohsin-wiserclaude
authored
chore(deps): upgrade to ESLint 9 flat config (#339)
- Remove eslint-config-react-app (and 163 transitive dependencies) - Upgrade ESLint from v8 to v9 - Create eslint.config.mjs with flat config format - Remove eslintConfig from package.json - Add @eslint/js and globals packages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Mohsin Hashmi <mhashmi@wiser.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d0481da commit 9c5f895

3 files changed

Lines changed: 358 additions & 2779 deletions

File tree

apps/frontend/eslint.config.mjs

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import reactPlugin from 'eslint-plugin-react';
4+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
5+
import importPlugin from 'eslint-plugin-import';
6+
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
7+
8+
export default [
9+
js.configs.recommended,
10+
{
11+
files: ['**/*.{js,jsx}'],
12+
languageOptions: {
13+
ecmaVersion: 'latest',
14+
sourceType: 'module',
15+
globals: {
16+
...globals.browser,
17+
...globals.es2021,
18+
...globals.node,
19+
},
20+
parserOptions: {
21+
ecmaFeatures: {
22+
jsx: true,
23+
},
24+
},
25+
},
26+
plugins: {
27+
react: reactPlugin,
28+
'react-hooks': reactHooksPlugin,
29+
import: importPlugin,
30+
'jsx-a11y': jsxA11yPlugin,
31+
},
32+
settings: {
33+
react: {
34+
version: 'detect',
35+
},
36+
},
37+
rules: {
38+
// React rules
39+
...reactPlugin.configs.recommended.rules,
40+
'react/react-in-jsx-scope': 'off', // Not needed in React 17+
41+
'react/prop-types': 'off', // Disable prop-types (using TypeScript or just JS)
42+
'react/display-name': 'off',
43+
44+
// React Hooks rules
45+
'react-hooks/rules-of-hooks': 'error',
46+
'react-hooks/exhaustive-deps': 'warn',
47+
48+
// Import rules
49+
'import/no-unresolved': 'off', // Handled by bundler
50+
'import/order': 'off',
51+
52+
// General rules
53+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
54+
'no-console': 'off',
55+
eqeqeq: 'warn',
56+
'no-self-assign': 'warn',
57+
'array-callback-return': 'warn',
58+
59+
// JSX a11y rules (warnings to avoid breaking existing code)
60+
'jsx-a11y/anchor-is-valid': 'warn',
61+
'jsx-a11y/click-events-have-key-events': 'off',
62+
'jsx-a11y/no-static-element-interactions': 'off',
63+
},
64+
},
65+
{
66+
// Test files configuration
67+
files: ['**/*.test.{js,jsx}', '**/__tests__/**/*.{js,jsx}'],
68+
languageOptions: {
69+
globals: {
70+
...globals.jest,
71+
vi: 'readonly',
72+
describe: 'readonly',
73+
it: 'readonly',
74+
expect: 'readonly',
75+
beforeEach: 'readonly',
76+
afterEach: 'readonly',
77+
beforeAll: 'readonly',
78+
afterAll: 'readonly',
79+
},
80+
},
81+
},
82+
{
83+
// Ignore patterns
84+
ignores: [
85+
'dist/**',
86+
'build/**',
87+
'node_modules/**',
88+
'coverage/**',
89+
'*.config.js',
90+
'vite.config.js',
91+
],
92+
},
93+
];

0 commit comments

Comments
 (0)