@@ -13,143 +13,174 @@ import { FlatCompat } from "@eslint/eslintrc";
1313const __filename = fileURLToPath ( import . meta. url ) ;
1414const __dirname = path . dirname ( __filename ) ;
1515const compat = new FlatCompat ( {
16- baseDirectory : __dirname ,
17- recommendedConfig : js . configs . recommended ,
18- allConfig : js . configs . all
16+ baseDirectory : __dirname ,
17+ recommendedConfig : js . configs . recommended ,
18+ allConfig : js . configs . all ,
1919} ) ;
2020
21- export default [ {
22- ignores : [ "src/assets" , "src/hooks/contracts/generated.ts" , "src/graphql/**/*.ts" ] ,
23- } , ...fixupConfigRules ( compat . extends (
24- "next/core-web-vitals" ,
25- "eslint:recommended" ,
26- "plugin:react/recommended" ,
27- "plugin:react-hooks/recommended" ,
28- "plugin:import/recommended" ,
29- "plugin:import/react" ,
30- "plugin:security/recommended" ,
31- "plugin:@typescript-eslint/recommended" ,
32- "plugin:prettier/recommended" ,
33- "prettier" ,
34- ) ) , {
21+ export default [
22+ {
23+ ignores : [ "src/assets" , "src/hooks/contracts/generated.ts" , "src/graphql-generated/**/*.ts" ] ,
24+ } ,
25+ ...fixupConfigRules (
26+ compat . extends (
27+ "next/core-web-vitals" ,
28+ "eslint:recommended" ,
29+ "plugin:react/recommended" ,
30+ "plugin:react-hooks/recommended" ,
31+ "plugin:import/recommended" ,
32+ "plugin:import/react" ,
33+ "plugin:security/recommended" ,
34+ "plugin:@typescript-eslint/recommended" ,
35+ "plugin:prettier/recommended" ,
36+ "prettier"
37+ )
38+ ) ,
39+ {
3540 plugins : {
36- react : fixupPluginRules ( react ) ,
37- "react-hooks" : fixupPluginRules ( reactHooks ) ,
38- security : fixupPluginRules ( security ) ,
39- import : fixupPluginRules ( _import ) ,
41+ react : fixupPluginRules ( react ) ,
42+ "react-hooks" : fixupPluginRules ( reactHooks ) ,
43+ security : fixupPluginRules ( security ) ,
44+ import : fixupPluginRules ( _import ) ,
4045 } ,
4146
4247 languageOptions : {
43- globals : {
44- ...globals . browser ,
45- ...globals . node ,
46- Atomics : "readonly" ,
47- SharedArrayBuffer : "readonly" ,
48+ globals : {
49+ ...globals . browser ,
50+ ...globals . node ,
51+ Atomics : "readonly" ,
52+ SharedArrayBuffer : "readonly" ,
53+ } ,
54+
55+ parser : tsParser ,
56+ ecmaVersion : 2020 ,
57+ sourceType : "module" ,
58+
59+ parserOptions : {
60+ ecmaFeatures : {
61+ jsx : true ,
4862 } ,
63+ } ,
64+ } ,
4965
50- parser : tsParser ,
51- ecmaVersion : 2020 ,
52- sourceType : "module" ,
66+ settings : {
67+ react : {
68+ version : "^16.12.0" ,
69+ } ,
70+
71+ "import/resolver" : {
72+ typescript : {
73+ alwaysTryTypes : true ,
74+ project : "./tsconfig.json" ,
75+ } ,
5376
54- parserOptions : {
55- ecmaFeatures : {
56- jsx : true ,
57- } ,
77+ node : {
78+ extensions : [ ".js" , ".jsx" , ".ts" , ".tsx" ] ,
5879 } ,
80+ } ,
5981 } ,
6082
61- settings : {
62- react : {
63- version : "^16.12.0" ,
83+ rules : {
84+ "max-len" : [
85+ "warn" ,
86+ {
87+ code : 120 ,
6488 } ,
89+ ] ,
6590
66- "import/resolver" : {
67- typescript : {
68- alwaysTryTypes : true ,
69- project : "./tsconfig.json" ,
70- } ,
91+ "react/prop-types" : 0 ,
92+ "no-unused-vars" : "off" ,
7193
72- node : {
73- extensions : [ ".js" , ".jsx" , ".ts" , ".tsx" ] ,
74- } ,
94+ "@typescript-eslint/no-unused-vars" : [
95+ "error" ,
96+ {
97+ varsIgnorePattern : "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)" ,
98+ argsIgnorePattern : "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)" ,
7599 } ,
76- } ,
100+ ] ,
77101
78- rules : {
79- "max-len" : [ "warn" , {
80- code : 120 ,
81- } ] ,
82-
83- "react/prop-types" : 0 ,
84- "no-unused-vars" : "off" ,
85-
86- "@typescript-eslint/no-unused-vars" : [ "error" , {
87- varsIgnorePattern : "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)" ,
88- argsIgnorePattern : "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)" ,
89- } ] ,
90-
91- "no-console" : [ "error" , {
92- allow : [ "warn" , "error" , "info" , "debug" ] ,
93- } ] ,
94-
95- "@typescript-eslint/no-non-null-assertion" : "off" ,
96- "@typescript-eslint/no-explicit-any" : "off" ,
97- "security/detect-object-injection" : "off" ,
98- "security/detect-non-literal-fs-filename" : "off" ,
99-
100- "import/extensions" : [ "error" , "ignorePackages" , {
101- js : "never" ,
102- jsx : "never" ,
103- ts : "never" ,
104- tsx : "never" ,
105- } ] ,
106-
107- "import/no-unresolved" : "off" ,
108-
109- "import/order" : [ "warn" , {
110- groups : [ "builtin" , "external" , "internal" , "parent" , "sibling" , "index" ] ,
111-
112- pathGroups : [ {
113- pattern : "{react,styled-components}" ,
114- group : "external" ,
115- position : "before" ,
116- } , {
117- pattern : "@kleros/**" ,
118- group : "external" ,
119- position : "after" ,
120- } , {
121- pattern : "{svgs/**,assets/**}" ,
122- group : "internal" ,
123- position : "after" ,
124- } , {
125- pattern : "{hooks/**,utils/**,consts/**,types/**,context/**,connectors/**,}" ,
126- group : "internal" ,
127- position : "after" ,
128- } , {
129- pattern : "{queries/**,}" ,
130- group : "internal" ,
131- position : "after" ,
132- } , {
133- pattern : "{src/**,}" ,
134- group : "internal" ,
135- position : "after" ,
136- } , {
137- pattern : "{styles/**,}" ,
138- group : "internal" ,
139- position : "after" ,
140- } , {
141- pattern : "{layout/**,pages/**,components/**,}" ,
142- group : "internal" ,
143- position : "after" ,
144- } ] ,
145-
146- pathGroupsExcludedImportTypes : [ "builtin" ] ,
147- "newlines-between" : "always" ,
148-
149- alphabetize : {
150- order : "asc" ,
151- caseInsensitive : true ,
102+ "no-console" : [
103+ "error" ,
104+ {
105+ allow : [ "warn" , "error" , "info" , "debug" ] ,
106+ } ,
107+ ] ,
108+
109+ "@typescript-eslint/no-non-null-assertion" : "off" ,
110+ "@typescript-eslint/no-explicit-any" : "off" ,
111+ "security/detect-object-injection" : "off" ,
112+ "security/detect-non-literal-fs-filename" : "off" ,
113+
114+ "import/extensions" : [
115+ "error" ,
116+ "ignorePackages" ,
117+ {
118+ js : "never" ,
119+ jsx : "never" ,
120+ ts : "never" ,
121+ tsx : "never" ,
122+ } ,
123+ ] ,
124+
125+ "import/no-unresolved" : "off" ,
126+
127+ "import/order" : [
128+ "warn" ,
129+ {
130+ groups : [ "builtin" , "external" , "internal" , "parent" , "sibling" , "index" ] ,
131+
132+ pathGroups : [
133+ {
134+ pattern : "{react,styled-components}" ,
135+ group : "external" ,
136+ position : "before" ,
137+ } ,
138+ {
139+ pattern : "@kleros/**" ,
140+ group : "external" ,
141+ position : "after" ,
142+ } ,
143+ {
144+ pattern : "{svgs/**,assets/**}" ,
145+ group : "internal" ,
146+ position : "after" ,
147+ } ,
148+ {
149+ pattern : "{hooks/**,utils/**,consts/**,types/**,context/**,connectors/**,}" ,
150+ group : "internal" ,
151+ position : "after" ,
152+ } ,
153+ {
154+ pattern : "{queries/**,}" ,
155+ group : "internal" ,
156+ position : "after" ,
152157 } ,
153- } ] ,
158+ {
159+ pattern : "{src/**,}" ,
160+ group : "internal" ,
161+ position : "after" ,
162+ } ,
163+ {
164+ pattern : "{styles/**,}" ,
165+ group : "internal" ,
166+ position : "after" ,
167+ } ,
168+ {
169+ pattern : "{layout/**,pages/**,components/**,}" ,
170+ group : "internal" ,
171+ position : "after" ,
172+ } ,
173+ ] ,
174+
175+ pathGroupsExcludedImportTypes : [ "builtin" ] ,
176+ "newlines-between" : "always" ,
177+
178+ alphabetize : {
179+ order : "asc" ,
180+ caseInsensitive : true ,
181+ } ,
182+ } ,
183+ ] ,
154184 } ,
155- } ] ;
185+ } ,
186+ ] ;
0 commit comments