@@ -23,49 +23,50 @@ import { Step, Steps } from "fumadocs-ui/components/steps";
2323 <Step >
2424 ## Configure ESLint
2525
26- ``` js title="eslint.config.js"
27- // @ts-check
28- import eslintJs from " @eslint/js" ;
26+ ``` ts title="eslint.config.js"
2927 import eslintReact from " @eslint-react/eslint-plugin" ;
28+ import eslintJs from " @eslint/js" ;
29+ import { defineConfig } from " eslint/config" ;
3030 import tseslint from " typescript-eslint" ;
3131
32- export default tseslint .config ({
33- files: [" **/*.ts" , " **/*.tsx" ],
34-
35- // Extend recommended rule sets from:
36- // 1. ESLint JS's recommended rules
37- // 2. TypeScript ESLint recommended rules
38- // 3. ESLint React's recommended-typescript rules
39- extends: [
40- eslintJs .configs .recommended ,
41- tseslint .configs .recommended ,
42- eslintReact .configs [" recommended-typescript" ],
43- ],
44-
45- // Configure language/parsing options
46- languageOptions: {
47- // Use TypeScript ESLint parser for TypeScript files
48- parser: tseslint .parser ,
49- parserOptions: {
50- // Enable project service for better TypeScript integration
51- projectService: true ,
52- tsconfigRootDir: import .meta.dirname,
32+ export default defineConfig ([
33+ {
34+ files: [" **/*.ts" , " **/*.tsx" ],
35+
36+ // Extend recommended rule sets from:
37+ // 1. ESLint JS's recommended rules
38+ // 2. TypeScript ESLint recommended rules
39+ // 3. ESLint React's recommended-typescript rules
40+ extends: [
41+ eslintJs .configs .recommended ,
42+ tseslint .configs .recommended ,
43+ eslintReact .configs [" recommended-typescript" ],
44+ ],
45+
46+ // Configure language/parsing options
47+ languageOptions: {
48+ // Use TypeScript ESLint parser for TypeScript files
49+ parser: tseslint .parser ,
50+ parserOptions: {
51+ // Enable project service for better TypeScript integration
52+ projectService: true ,
53+ tsconfigRootDir: import .meta .dirname ,
54+ },
5355 },
54- },
5556
56- // Custom rule overrides (modify rule levels or disable rules)
57- rules: {
58- " @eslint-react/no-missing-key" : " warn" ,
57+ // Custom rule overrides (modify rule levels or disable rules)
58+ rules: {
59+ " @eslint-react/no-missing-key" : " warn" ,
60+ },
5961 },
60- } );
62+ ] );
6163 ```
6264 </Step >
6365
6466 <Step >
6567 ## Configure [ Project Config] ( /docs/glossary#project-config ) (Optional)
6668
6769 ``` ts title="eslint.config.js"
68- // @ts-check
6970 import tseslint from " typescript-eslint" ;
7071
7172 export default [
0 commit comments