@@ -21,14 +21,12 @@ export default tseslint.config(
2121 "**/dist/**/*"
2222 ] ,
2323 plugins : {
24- // @ts -ignore
25- react,
24+ "react" : /** @type {import("eslint").ESLint.Plugin } */ ( react ) ,
2625 "react-refresh" : reactRefresh ,
2726 } ,
2827 rules : {
2928 "quotes" : [ "error" , "double" ] ,
3029 "no-unused-vars" : "off" ,
31- "@typescript-eslint/ban-types" : "off" ,
3230 "indent" : [
3331 "error" ,
3432 "tab" ,
@@ -46,38 +44,112 @@ export default tseslint.config(
4644 "default-case" : "off" ,
4745 "arrow-parens" : "error" ,
4846 "space-infix-ops" : "warn" ,
49- "react/no-multi-comp" : [
50- "error" ,
47+ "comma-spacing" : "warn" ,
48+ "comma-dangle" : [
49+ "warn" ,
5150 {
52- "ignoreStateless" : true
51+ "arrays" : "always-multiline" ,
52+ "objects" : "always-multiline" ,
53+ "imports" : "always-multiline" ,
54+ "exports" : "always-multiline" ,
55+ "functions" : "never"
5356 }
5457 ] ,
55- "comma -spacing" : "warn " ,
56- "@typescript-eslint /no-unused-vars " : [
57- "warn " ,
58+ "keyword -spacing" : "error " ,
59+ "react /no-multi-comp " : [
60+ "error " ,
5861 {
59- "argsIgnorePattern " : "^_"
62+ "ignoreStateless " : true
6063 }
6164 ] ,
65+ "react/no-invalid-html-attribute" : "error" ,
66+ "react/boolean-prop-naming" : "warn" ,
67+ "react/jsx-handler-names" : "warn" ,
6268 "react-refresh/only-export-components" : [
6369 "warn" ,
6470 { "allowConstantExport" : true }
6571 ] ,
66- "@typescript-eslint/await-thenable" : "off" ,
67- "react/boolean-prop-naming" : "warn" ,
68- "react/jsx-handler-names" : "warn" ,
69- "comma-dangle" : [
72+ "@typescript-eslint/ban-types" : "off" ,
73+ "@typescript-eslint/no-unused-vars" : [
7074 "warn" ,
7175 {
72- "arrays" : "always-multiline" ,
73- "objects" : "always-multiline" ,
74- "imports" : "always-multiline" ,
75- "exports" : "always-multiline" ,
76- "functions" : "never"
76+ "args" : "all" ,
77+ "argsIgnorePattern" : "^_" ,
78+ "caughtErrors" : "all" ,
79+ "caughtErrorsIgnorePattern" : "^_" ,
80+ "destructuredArrayIgnorePattern" : "^_" ,
81+ "varsIgnorePattern" : "^_" ,
82+ "ignoreRestSiblings" : true
7783 }
7884 ] ,
79- "keyword-spacing" : "error" ,
80- "react/no-invalid-html-attribute" : "error" ,
85+ "@typescript-eslint/naming-convention" : [
86+ "error" ,
87+ {
88+ selector : "default" ,
89+ format : [ "camelCase" ] ,
90+ leadingUnderscore : "allow" ,
91+ trailingUnderscore : "allow" ,
92+ } ,
93+ {
94+ selector : "import" ,
95+ format : [ "camelCase" , "PascalCase" ] ,
96+ } ,
97+ {
98+ // React components and Variables
99+ selector : "variable" ,
100+ format : [ "camelCase" , "UPPER_CASE" , "PascalCase" ] ,
101+ leadingUnderscore : "allow" ,
102+ } ,
103+ {
104+ // Types and enum members
105+ selector : [ "typeLike" , "enumMember" ] ,
106+ format : [ "PascalCase" ] ,
107+ } ,
108+ {
109+ // React components, functions and properties
110+ selector : [
111+ "function" ,
112+ "parameter" ,
113+ "classProperty" ,
114+ "objectLiteralProperty" ,
115+ "typeProperty" ,
116+ "classMethod" ,
117+ "objectLiteralMethod" ,
118+ "typeMethod" ,
119+ "accessor" ,
120+ ] ,
121+ format : [ "camelCase" , "PascalCase" ] ,
122+ leadingUnderscore : "allow" ,
123+ } ,
124+ {
125+ // Static class fields
126+ selector : "classProperty" ,
127+ modifiers : [ "static" ] ,
128+ format : [ "UPPER_CASE" ] ,
129+ } ,
130+ {
131+ // Ignore destructured variables and parameters
132+ selector : [ "variable" , "parameter" ] ,
133+ modifiers : [ "destructured" ] ,
134+ format : null ,
135+ } ,
136+ {
137+ // Ignore properties that require quotes
138+ selector : [
139+ "classProperty" ,
140+ "objectLiteralProperty" ,
141+ "typeProperty" ,
142+ "classMethod" ,
143+ "objectLiteralMethod" ,
144+ "typeMethod" ,
145+ "accessor" ,
146+ "enumMember" ,
147+ ] ,
148+ modifiers : [ "requiresQuotes" ] ,
149+ format : null ,
150+ } ,
151+ ] ,
152+ "@typescript-eslint/await-thenable" : "off"
81153 } ,
82154 }
83155) ;
0 commit comments