Skip to content

Commit 1b3b702

Browse files
authored
fix(create-vite): move ESLint "ignores" config to a separate object in React templates (#17885)
1 parent 83355a6 commit 1b3b702

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

packages/create-vite/template-react-ts/eslint.config.js

+21-19
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ import reactHooks from 'eslint-plugin-react-hooks'
44
import reactRefresh from 'eslint-plugin-react-refresh'
55
import tseslint from 'typescript-eslint'
66

7-
export default tseslint.config({
8-
extends: [js.configs.recommended, ...tseslint.configs.recommended],
9-
files: ['**/*.{ts,tsx}'],
10-
ignores: ['dist'],
11-
languageOptions: {
12-
ecmaVersion: 2020,
13-
globals: globals.browser,
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
1427
},
15-
plugins: {
16-
'react-hooks': reactHooks,
17-
'react-refresh': reactRefresh,
18-
},
19-
rules: {
20-
...reactHooks.configs.recommended.rules,
21-
'react-refresh/only-export-components': [
22-
'warn',
23-
{ allowConstantExport: true },
24-
],
25-
},
26-
})
28+
)

packages/create-vite/template-react/eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import reactHooks from 'eslint-plugin-react-hooks'
55
import reactRefresh from 'eslint-plugin-react-refresh'
66

77
export default [
8+
{ ignores: ['dist'] },
89
{
910
files: ['**/*.{js,jsx}'],
10-
ignores: ['dist'],
1111
languageOptions: {
1212
ecmaVersion: 2020,
1313
globals: globals.browser,

0 commit comments

Comments
 (0)