1+ {
2+ "env" : {
3+ "browser" : true ,
4+ "es2022" : true ,
5+ "node" : true
6+ },
7+ "extends" : [
8+ " eslint:recommended" ,
9+ " @typescript-eslint/recommended" ,
10+ " plugin:react/recommended" ,
11+ " plugin:react-hooks/recommended" ,
12+ " plugin:jsx-a11y/recommended"
13+ ],
14+ "parser" : " @typescript-eslint/parser" ,
15+ "parserOptions" : {
16+ "ecmaVersion" : " latest" ,
17+ "sourceType" : " module" ,
18+ "ecmaFeatures" : {
19+ "jsx" : true
20+ }
21+ },
22+ "plugins" : [
23+ " react" ,
24+ " react-hooks" ,
25+ " @typescript-eslint" ,
26+ " jsx-a11y"
27+ ],
28+ "rules" : {
29+ // 代码质量规则
30+ "no-unused-vars" : " warn" ,
31+ "no-unused-imports" : " error" ,
32+ "no-explicit-any" : " warn" ,
33+ "no-array-index-key" : " warn" ,
34+ "no-debugger" : " error" ,
35+ "no-duplicate-case" : " error" ,
36+ "no-duplicate-imports" : " error" ,
37+ "no-empty" : " warn" ,
38+ "no-extra-boolean-cast" : " error" ,
39+ "no-fallthrough" : " error" ,
40+ "no-prototype-builtins" : " error" ,
41+ "no-redeclare" : " error" ,
42+ "no-shadow" : " error" ,
43+ "no-undef" : " error" ,
44+ "no-unreachable" : " error" ,
45+ "no-unsafe-negation" : " error" ,
46+ "use-isnan" : " error" ,
47+ "valid-typeof" : " error" ,
48+ // 代码风格规则
49+ "prefer-const" : " error" ,
50+ "prefer-template" : " error" ,
51+ "no-var" : " error" ,
52+ "prefer-arrow-callback" : " error" ,
53+ "arrow-spacing" : " error" ,
54+ "comma-dangle" : [
55+ " error" ,
56+ " es5"
57+ ],
58+ "comma-spacing" : " error" ,
59+ "comma-style" : " error" ,
60+ "computed-property-spacing" : " error" ,
61+ "func-call-spacing" : " error" ,
62+ "key-spacing" : " error" ,
63+ "keyword-spacing" : " error" ,
64+ "object-curly-spacing" : [
65+ " error" ,
66+ " always"
67+ ],
68+ "semi" : [
69+ " error" ,
70+ " always"
71+ ],
72+ "semi-spacing" : " error" ,
73+ "space-before-blocks" : " error" ,
74+ "space-before-function-paren" : [
75+ " error" ,
76+ " never"
77+ ],
78+ "space-in-parens" : " error" ,
79+ "space-infix-ops" : " error" ,
80+ "space-unary-ops" : " error" ,
81+ "spaced-comment" : " error" ,
82+ // TypeScript 特定规则
83+ "@typescript-eslint/no-unused-vars" : " warn" ,
84+ "@typescript-eslint/no-explicit-any" : " warn" ,
85+ "@typescript-eslint/explicit-function-return-type" : " off" ,
86+ "@typescript-eslint/explicit-module-boundary-types" : " off" ,
87+ "@typescript-eslint/no-inferrable-types" : " off" ,
88+ "@typescript-eslint/prefer-optional-chain" : " error" ,
89+ "@typescript-eslint/prefer-nullish-coalescing" : " error" ,
90+ // React 特定规则
91+ "react/react-in-jsx-scope" : " off" ,
92+ "react/prop-types" : " off" ,
93+ "react-hooks/rules-of-hooks" : " error" ,
94+ "react-hooks/exhaustive-deps" : " warn" ,
95+ // 可访问性规则(部分关闭,保持与biome配置一致)
96+ "jsx-a11y/click-events-have-key-events" : " off" ,
97+ "jsx-a11y/no-static-element-interactions" : " off" ,
98+ "jsx-a11y/anchor-is-valid" : " warn" ,
99+ "jsx-a11y/alt-text" : " warn" ,
100+ "jsx-a11y/aria-props" : " warn" ,
101+ "jsx-a11y/aria-proptypes" : " warn" ,
102+ "jsx-a11y/aria-unsupported-elements" : " warn" ,
103+ "jsx-a11y/role-has-required-aria-props" : " warn" ,
104+ "jsx-a11y/role-supports-aria-props" : " warn"
105+ },
106+ "settings" : {
107+ "react" : {
108+ "version" : " detect"
109+ }
110+ },
111+ "ignorePatterns" : [
112+ " node_modules/" ,
113+ " dist/" ,
114+ " build/" ,
115+ " *.min.js" ,
116+ " *.bundle.js"
117+ ]
118+ }
0 commit comments