Skip to content

Commit e912080

Browse files
authored
docs(create-vite): recommend eslint-react for linting (#19524)
1 parent ce0ccc6 commit e912080

File tree

1 file changed

+9
-9
lines changed
  • packages/create-vite/template-react-ts

1 file changed

+9
-9
lines changed

packages/create-vite/template-react-ts/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ export default tseslint.config({
3131
})
3232
```
3333

34-
You can also install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) for React-specific lint rules:
34+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
3535

3636
```js
3737
// eslint.config.js
38-
import react from 'eslint-plugin-react'
38+
import reactX from 'eslint-plugin-react-x'
39+
import reactDom from 'eslint-plugin-react-dom'
3940

4041
export default tseslint.config({
41-
// Set the react version
42-
settings: { react: { version: '19.0' } },
4342
plugins: {
44-
// Add the react plugin
45-
react,
43+
// Add the react-x and react-dom plugins
44+
'react-x': reactX,
45+
'react-dom': reactDom,
4646
},
4747
rules: {
4848
// other rules...
49-
// Enable its recommended rules
50-
...react.configs.recommended.rules,
51-
...react.configs['jsx-runtime'].rules,
49+
// Enable its recommended typescript rules
50+
...reactX.configs['recommended-typescript'].rules,
51+
...reactDom.configs.recommended.rules,
5252
},
5353
})
5454
```

0 commit comments

Comments
 (0)