1- import { defineConfig , globalIgnores } from 'eslint/config'
1+ import { defineConfig } from 'eslint/config'
22import globals from 'globals'
33import jsPlugin from '@eslint/js'
44import tsPlugin from 'typescript-eslint'
@@ -7,56 +7,43 @@ import prettierPlugin from 'eslint-plugin-prettier/recommended'
77
88export default defineConfig ( [
99 {
10- files : [ '**/*.{js,mjs,cjs,ts,jsx,tsx}' ] ,
10+ name : 'global ignores' ,
11+ ignores : [ '**/coverage/**/*' , '**/dist/**/*' , 'docs/.vitepress/dist/**/*' , 'docs/.vitepress/cache/**/*' ] ,
1112 } ,
1213
13- globalIgnores ( [ '**/coverage/**/*' , '**/dist/**/*' , 'docs/.vitepress/dist/**/*' , 'docs/.vitepress/cache/**/*' ] ) ,
14+ {
15+ name : 'js recommended' ,
16+ ...jsPlugin . configs . recommended ,
17+ } ,
1418
15- jsPlugin . configs . recommended ,
19+ ... tsPlugin . configs . recommendedTypeChecked ,
1620
1721 {
18- files : [ 'examples/react/**/*.{ts,tsx}' ] ,
19- languageOptions : {
20- parserOptions : {
21- project : 'examples/react/tsconfig.eslint.json' ,
22- tsconfigRootDir : import . meta. dirname ,
23- } ,
24- } ,
22+ name : 'react recommended' ,
23+ ...reactPlugin . configs . flat . recommended ,
2524 } ,
2625
2726 {
28- files : [ 'packages/core/**/*.{ts,tsx}' ] ,
29- languageOptions : {
30- parserOptions : {
31- project : 'packages/core/tsconfig.eslint.json' ,
32- tsconfigRootDir : import . meta. dirname ,
33- } ,
34- } ,
27+ name : 'react jsx runtime' ,
28+ ...reactPlugin . configs . flat [ 'jsx-runtime' ] ,
3529 } ,
3630
31+ prettierPlugin ,
32+
3733 {
38- files : [ 'packages/react/**/*.{ts,tsx}' ] ,
34+ name : 'ts configuration' ,
35+ files : [ '**/*.{ts,tsx}' ] ,
3936 languageOptions : {
4037 parserOptions : {
41- project : 'packages/react/tsconfig.eslint.json' ,
38+ projectService : true ,
4239 tsconfigRootDir : import . meta. dirname ,
4340 } ,
4441 } ,
45- } ,
46-
47- ...tsPlugin . configs . recommendedTypeChecked . map ( config => ( {
48- ...config ,
49- files : [ '**/*.{ts,tsx}' ] ,
5042 rules : {
5143 'no-unused-vars' : 'off' ,
5244
5345 '@typescript-eslint/consistent-type-imports' : 'error' ,
5446 '@typescript-eslint/consistent-type-exports' : 'error' ,
55- '@typescript-eslint/no-unsafe-assignment' : 'off' ,
56- '@typescript-eslint/no-unsafe-return' : 'off' ,
57- '@typescript-eslint/no-unsafe-member-access' : 'off' ,
58- '@typescript-eslint/no-unsafe-argument' : 'off' ,
59- '@typescript-eslint/no-explicit-any' : 'off' ,
6047 '@typescript-eslint/no-unused-vars' : [
6148 'error' ,
6249 {
@@ -66,14 +53,11 @@ export default defineConfig([
6653 } ,
6754 ] ,
6855 } ,
69- } ) ) ,
70-
71- reactPlugin . configs . flat . recommended ,
72- reactPlugin . configs . flat [ 'jsx-runtime' ] ,
73-
74- prettierPlugin ,
56+ } ,
7557
7658 {
59+ name : 'global configuration' ,
60+
7761 languageOptions : {
7862 ...reactPlugin . configs . flat . recommended . languageOptions ,
7963
0 commit comments