1- import globals from "globals" ;
2- import tsPlugin from "@typescript-eslint/eslint-plugin" ;
3- import eslintJsPlugin from "@eslint/js" ;
4- import importNewlines from "eslint-plugin-import-newlines" ;
5- import typescriptParser from "@typescript-eslint/parser" ;
1+ import globals from "globals"
2+ import tsPlugin from "@typescript-eslint/eslint-plugin"
3+ import eslintJsPlugin from "@eslint/js"
4+ import importNewlines from "eslint-plugin-import-newlines"
5+ import typescriptParser from "@typescript-eslint/parser"
66import react from "eslint-plugin-react"
77
88const commonConfig = {
@@ -17,16 +17,16 @@ const commonConfig = {
1717 "@typescript-eslint/array-type" : [
1818 "error" ,
1919 {
20- default : "generic" ,
21- } ,
20+ default : "generic"
21+ }
2222 ] ,
2323
2424 "@typescript-eslint/consistent-type-assertions" : [
2525 "error" ,
2626 {
2727 assertionStyle : "as" ,
28- objectLiteralTypeAssertions : "never" ,
29- } ,
28+ objectLiteralTypeAssertions : "never"
29+ }
3030 ] ,
3131
3232 "block-spacing" : "error" ,
@@ -37,8 +37,8 @@ const commonConfig = {
3737 "error" ,
3838 {
3939 before : false ,
40- after : true ,
41- } ,
40+ after : true
41+ }
4242 ] ,
4343
4444 "dot-location" : [ "error" , "property" ] ,
@@ -50,37 +50,39 @@ const commonConfig = {
5050 "error" ,
5151 "declaration" ,
5252 {
53- allowArrowFunctions : true ,
54- } ,
53+ allowArrowFunctions : true
54+ }
5555 ] ,
5656
5757 "import-newlines/enforce" : [
5858 "error" ,
5959 {
6060 items : 3 ,
6161 "max-len" : 120 ,
62- semi : false ,
63- } ,
62+ semi : false
63+ }
6464 ] ,
6565
6666 // TEMPORARY: Disabled due to ESLint indent rule stack overflow bug with Layout.tsx
6767 // Issue tracked across ESLint 8.x and 9.x versions - re-enable when fixed upstream
68- // "indent": [
69- // "error",
70- // 2,
71- // {
72- // SwitchCase: 1,
73- // },
74- // ],
68+ //see: https://github.com/eslint-stylistic/eslint-stylistic/issues/915
69+ // Re-enabled for now, issue is still present but can be avoided by using explicit react <Fragment> elements
70+ "indent" : [
71+ "error" ,
72+ 2 ,
73+ {
74+ SwitchCase : 1
75+ }
76+ ] ,
7577
7678 "max-len" : [ "error" , 120 ] ,
7779 "no-multi-spaces" : "error" ,
7880
7981 "no-multiple-empty-lines" : [
8082 "error" ,
8183 {
82- max : 1 ,
83- } ,
84+ max : 1
85+ }
8486 ] ,
8587
8688 "no-trailing-spaces" : "error" ,
@@ -91,13 +93,13 @@ const commonConfig = {
9193 "double" ,
9294 {
9395 allowTemplateLiterals : true ,
94- avoidEscape : true ,
95- } ,
96+ avoidEscape : true
97+ }
9698 ] ,
9799
98- semi : [ "error" , "never" ] ,
99- } ,
100- } ;
100+ semi : [ "error" , "never" ]
101+ }
102+ }
101103
102104export default [
103105 {
@@ -109,31 +111,31 @@ export default [
109111 "**/node_modules/**" ,
110112 "**/.next/**" ,
111113 "**/.tsconfig.tsbuildinfo/**"
112- ] ,
114+ ]
113115 } ,
114116 {
115- rules : eslintJsPlugin . configs . recommended . rules ,
117+ rules : eslintJsPlugin . configs . recommended . rules
116118 } ,
117119 {
118120 files : [ "**/*.ts" ] ,
119121
120122 languageOptions : {
121123 parser : typescriptParser ,
122124 globals : {
123- ...globals . node ,
124- } ,
125+ ...globals . node
126+ }
125127 } ,
126- ...commonConfig ,
128+ ...commonConfig
127129 } ,
128130 {
129- files : [ "**/*.js" , ] ,
131+ files : [ "**/*.js" ] ,
130132
131133 languageOptions : {
132134 globals : {
133- ...globals . node ,
134- } ,
135+ ...globals . node
136+ }
135137 } ,
136- ...commonConfig ,
138+ ...commonConfig
137139 } ,
138140 {
139141 files : [ "**/*.{jsx,mjs,cjs,ts,tsx}" ] ,
@@ -144,14 +146,14 @@ export default [
144146 parser : typescriptParser ,
145147 parserOptions : {
146148 ecmaFeatures : {
147- jsx : true ,
148- } ,
149- } ,
150- globals : {
151- ...globals . browser ,
149+ jsx : true
150+ }
152151 } ,
152+ globals : {
153+ ...globals . browser
154+ }
153155 } ,
154- ...commonConfig ,
156+ ...commonConfig
155157 } ,
156158 {
157159 files : [ "**/__tests__/*.{jsx,mjs,cjs,ts,tsx}" ] ,
@@ -162,15 +164,15 @@ export default [
162164 parser : typescriptParser ,
163165 parserOptions : {
164166 ecmaFeatures : {
165- jsx : true ,
166- } ,
167- } ,
168- globals : {
167+ jsx : true
168+ }
169+ } ,
170+ globals : {
169171 ...globals . browser ,
170172 ...globals . jest
171- } ,
173+ }
172174 } ,
173- ...commonConfig ,
175+ ...commonConfig
174176 } ,
175177 {
176178 files : [ "**/tests/**/*.ts" ] ,
@@ -179,9 +181,9 @@ export default [
179181 parser : typescriptParser ,
180182 globals : {
181183 ...globals . jest ,
182- ...globals . node ,
183- } ,
184+ ...globals . node
185+ }
184186 } ,
185- ...commonConfig ,
186- } ,
187- ] ;
187+ ...commonConfig
188+ }
189+ ]
0 commit comments