Skip to content

Commit 6c3a236

Browse files
committed
chore: fix lint
1 parent 5add362 commit 6c3a236

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

.vscode/settings.json

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"source.fixAll.eslint": "explicit",
44
"source.organizeImports": "never"
55
},
6-
"eslint.options": {
7-
"flags": ["unstable_ts_config"]
8-
},
96
"editor.formatOnSave": true,
107
"cSpell.words": ["antfu", "astro", "coderwyd", "rspack", "unocss"]
118
}

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
"@eslint-react/eslint-plugin": "^1.5.8",
5252
"@unocss/eslint-plugin": ">=0.50.0",
5353
"eslint": "^9.5.0",
54+
"eslint-plugin-react-compiler": "^19.0.0-beta-decd7b8-20250118",
5455
"eslint-plugin-react-hooks": "^4.6.0 || ^5.0.0",
5556
"eslint-plugin-react-refresh": "^0.4.4",
5657
"eslint-plugin-svelte": ">=2.35.1",
5758
"eslint-plugin-tailwindcss": "^3.16.0",
58-
"svelte-eslint-parser": ">=0.37.0",
59-
"eslint-plugin-react-compiler": "^19.0.0-beta-decd7b8-20250118"
59+
"svelte-eslint-parser": ">=0.37.0"
6060
},
6161
"peerDependenciesMeta": {
6262
"@eslint-react/eslint-plugin": {
@@ -65,6 +65,9 @@
6565
"@unocss/eslint-plugin": {
6666
"optional": true
6767
},
68+
"eslint-plugin-react-compiler": {
69+
"optional": true
70+
},
6871
"eslint-plugin-react-hooks": {
6972
"optional": true
7073
},
@@ -79,9 +82,6 @@
7982
},
8083
"svelte-eslint-parser": {
8184
"optional": true
82-
},
83-
"eslint-plugin-react-compiler": {
84-
"optional": true
8585
}
8686
},
8787
"dependencies": {

src/configs/react.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ export async function react(
6666
name: 'coderwyd/react/setup',
6767
plugins: {
6868
react: plugins['@eslint-react'],
69+
'react-compiler': pluginReactCompiler,
6970
'react-dom': plugins['@eslint-react/dom'],
7071
'react-hooks': pluginReactHooks,
7172
'react-hooks-extra': plugins['@eslint-react/hooks-extra'],
7273
'react-naming-convention': plugins['@eslint-react/naming-convention'],
7374
'react-refresh': pluginReactRefresh,
7475
'react-web-api': plugins['@eslint-react/web-api'],
75-
'react-compiler': pluginReactCompiler,
7676
},
7777
},
7878
{
@@ -87,16 +87,12 @@ export async function react(
8787
},
8888
name: 'coderwyd/react/rules',
8989
rules: {
90-
// recommended rules from @eslint-react/web-api
91-
'react-web-api/no-leaked-event-listener': 'warn',
92-
'react-web-api/no-leaked-interval': 'warn',
93-
'react-web-api/no-leaked-resize-observer': 'warn',
94-
'react-web-api/no-leaked-timeout': 'warn',
95-
90+
'react-compiler/react-compiler': 'warn',
9691
// recommended rules from @eslint-react/dom
9792
'react-dom/no-children-in-void-dom-elements': 'warn',
9893
'react-dom/no-dangerously-set-innerhtml': 'warn',
9994
'react-dom/no-dangerously-set-innerhtml-with-children': 'error',
95+
10096
'react-dom/no-find-dom-node': 'error',
10197
'react-dom/no-missing-button-type': 'warn',
10298
'react-dom/no-missing-iframe-sandbox': 'warn',
@@ -105,13 +101,9 @@ export async function react(
105101
'react-dom/no-script-url': 'warn',
106102
'react-dom/no-unsafe-iframe-sandbox': 'warn',
107103
'react-dom/no-unsafe-target-blank': 'warn',
108-
109-
'react-compiler/react-compiler': 'warn',
110-
111104
// recommended rules react-hooks
112105
'react-hooks/exhaustive-deps': 'warn',
113106
'react-hooks/rules-of-hooks': 'error',
114-
115107
// react refresh
116108
'react-refresh/only-export-components': [
117109
'warn',
@@ -142,6 +134,14 @@ export async function react(
142134
},
143135
],
144136

137+
// recommended rules from @eslint-react/web-api
138+
'react-web-api/no-leaked-event-listener': 'warn',
139+
140+
'react-web-api/no-leaked-interval': 'warn',
141+
'react-web-api/no-leaked-resize-observer': 'warn',
142+
143+
'react-web-api/no-leaked-timeout': 'warn',
144+
145145
// recommended rules from @eslint-react
146146
'react/ensure-forward-ref-using-ref': 'warn',
147147
'react/jsx-no-duplicate-props': 'warn',

0 commit comments

Comments
 (0)