@@ -14,35 +14,37 @@ If you are developing a production application, we recommend updating the config
1414- Configure the top-level ` parserOptions ` property like this:
1515
1616``` js
17- export default {
18- // other rules...
19- parserOptions : {
20- ecmaVersion : ' latest ' ,
21- sourceType : ' module ' ,
22- project : [ ' ./tsconfig.json ' , ' ./tsconfig.node.json ' , ' ./tsconfig.app.json ' ] ,
23- tsconfigRootDir : __dirname ,
17+ export default tseslint . config ( {
18+ languageOptions : {
19+ // other options...
20+ parserOptions : {
21+ project : [ ' ./tsconfig.node.json ' , ' ./tsconfig.app.json ' ] ,
22+ tsconfigRootDir : import .meta.dirname ,
23+ } ,
2424 },
25- }
25+ })
2626```
2727
28- - Replace ` tseslint.configs.recommended.rules ` to ` tseslint.configs['recommended-type-checked'].rules ` or ` tseslint.configs['strict-type-checked'].rules `
29- - Optionally add ` tseslint.configs['stylistic-type-checked'].rules `
28+ - Replace ` tseslint.configs.recommended ` to ` tseslint.configs.recommendedTypeChecked ` or ` tseslint.configs.strictTypeChecked `
29+ - Optionally add ` ... tseslint.configs.stylisticTypeChecked `
3030- Install [ eslint-plugin-react] ( https://github.com/jsx-eslint/eslint-plugin-react ) and update the config:
3131
3232``` js
3333// eslint.config.js
3434import react from ' eslint-plugin-react'
3535
36- export default {
37- // other rules...
36+ export default tseslint .config ({
37+ // Set the react version
38+ settings: { react: { version: ' 18.3' } },
3839 plugins: {
3940 // Add the react plugin
4041 react,
4142 },
4243 rules: {
44+ // other rules...
4345 // Enable its recommended rules
4446 ... react .configs .recommended .rules ,
4547 ... react .configs [' jsx-runtime' ].rules ,
4648 },
47- }
49+ })
4850```
0 commit comments