Skip to content

Commit 3c7c156

Browse files
DevSecNinjaCopilot
andauthored
fix(deps): replace abandoned eslint-plugin-react, unblock ESLint 10 (#107)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 609219e commit 3c7c156

4 files changed

Lines changed: 952 additions & 2427 deletions

File tree

eslint.config.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import js from '@eslint/js';
22
import globals from 'globals';
3-
import react from 'eslint-plugin-react';
3+
import eslintReact from '@eslint-react/eslint-plugin';
44
import reactHooks from 'eslint-plugin-react-hooks';
55
import reactRefresh from 'eslint-plugin-react-refresh';
6+
import tseslint from 'typescript-eslint';
67

78
export default [
89
{
@@ -19,25 +20,33 @@ export default [
1920
{
2021
files: ['**/*.{js,jsx}'],
2122
languageOptions: {
23+
parser: tseslint.parser,
2224
ecmaVersion: 2022,
2325
globals: { ...globals.browser, ...globals.node },
2426
parserOptions: {
2527
ecmaFeatures: { jsx: true },
2628
sourceType: 'module',
2729
},
2830
},
29-
settings: { react: { version: 'detect' } },
31+
},
32+
{
33+
files: ['**/*.{js,jsx}'],
34+
...eslintReact.configs.recommended,
35+
},
36+
{
37+
files: ['**/*.{js,jsx}'],
3038
plugins: {
31-
react,
3239
'react-hooks': reactHooks,
3340
'react-refresh': reactRefresh,
3441
},
3542
rules: {
36-
...react.configs.recommended.rules,
37-
...react.configs['jsx-runtime'].rules,
3843
...reactHooks.configs.recommended.rules,
39-
'react/prop-types': 'off',
4044
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
45+
// Opinionated @eslint-react rules left off to keep this migration behaviour-neutral;
46+
// revisit if we want to enforce them.
47+
'@eslint-react/no-array-index-key': 'off',
48+
'@eslint-react/use-state': 'off',
49+
'@eslint-react/set-state-in-effect': 'off',
4150
},
4251
},
4352
{

0 commit comments

Comments
 (0)