1- const { defineConfig, globalIgnores } = require ( " eslint/config" ) ;
1+ const { defineConfig, globalIgnores } = require ( ' eslint/config' ) ;
22
3- const globals = require ( " globals" ) ;
3+ const globals = require ( ' globals' ) ;
44
5- const { fixupConfigRules, fixupPluginRules } = require ( " @eslint/compat" ) ;
5+ const { fixupConfigRules, fixupPluginRules } = require ( ' @eslint/compat' ) ;
66
7- const tsParser = require ( " @typescript-eslint/parser" ) ;
8- const promise = require ( " eslint-plugin-promise" ) ;
9- const typescriptEslint = require ( " @typescript-eslint/eslint-plugin" ) ;
10- const _import = require ( " eslint-plugin-import" ) ;
11- const react = require ( " eslint-plugin-react" ) ;
12- const js = require ( " @eslint/js" ) ;
7+ const tsParser = require ( ' @typescript-eslint/parser' ) ;
8+ const promise = require ( ' eslint-plugin-promise' ) ;
9+ const typescriptEslint = require ( ' @typescript-eslint/eslint-plugin' ) ;
10+ const _import = require ( ' eslint-plugin-import' ) ;
11+ const react = require ( ' eslint-plugin-react' ) ;
12+ const js = require ( ' @eslint/js' ) ;
1313
14- const { FlatCompat } = require ( " @eslint/eslintrc" ) ;
14+ const { FlatCompat } = require ( ' @eslint/eslintrc' ) ;
1515
1616const compat = new FlatCompat ( {
1717 baseDirectory : __dirname ,
@@ -22,99 +22,99 @@ const compat = new FlatCompat({
2222const sharedSettings = {
2323 react : {
2424 // Avoid "React version detect" warning in a monorepo root
25- version : " 18.0" ,
25+ version : ' 18.0' ,
2626 } ,
27- " import/parsers" : {
28- " @typescript-eslint/parser" : [ " .ts" , " .tsx" ] ,
27+ ' import/parsers' : {
28+ ' @typescript-eslint/parser' : [ ' .ts' , ' .tsx' ] ,
2929 } ,
30- " import/resolver" : {
30+ ' import/resolver' : {
3131 typescript : {
3232 alwaysTryTypes : true ,
3333 project : [
34- " ./tsconfig.base.json" ,
35- " ./server/tsconfig.json" ,
36- " ./frontend/tsconfig.json" ,
37- " ./shared/tsconfig.json" ,
34+ ' ./tsconfig.base.json' ,
35+ ' ./server/tsconfig.json' ,
36+ ' ./frontend/tsconfig.json' ,
37+ ' ./shared/tsconfig.json' ,
3838 ] ,
3939 } ,
4040 node : true ,
4141 } ,
4242} ;
4343
4444const sharedRules = {
45- " import/extensions" : [
46- " error" ,
47- " ignorePackages" ,
48- { js : " never" , jsx : " never" , ts : " never" , tsx : " never" } ,
45+ ' import/extensions' : [
46+ ' error' ,
47+ ' ignorePackages' ,
48+ { js : ' never' , jsx : ' never' , ts : ' never' , tsx : ' never' } ,
4949 ] ,
50- " linebreak-style" : " off" ,
50+ ' linebreak-style' : ' off' ,
5151
5252 // The codebase uses the React 17+ JSX runtime (no need for `import React`)
53- " react/react-in-jsx-scope" : " off" ,
54- " react/jsx-uses-react" : " off" ,
53+ ' react/react-in-jsx-scope' : ' off' ,
54+ ' react/jsx-uses-react' : ' off' ,
5555
5656 // Keep CI green while we gradually clean up the repo.
57- " no-empty" : [ " warn" , { allowEmptyCatch : true } ] ,
58- " no-useless-assignment" : " warn" ,
59- " no-constant-binary-expression" : " warn" ,
60- " react/jsx-key" : " warn" ,
61- " preserve-caught-error" : " warn" ,
62- " react/prop-types" : " off" ,
63- " react/no-unescaped-entities" : " off" ,
64- " react/display-name" : " off" ,
57+ ' no-empty' : [ ' warn' , { allowEmptyCatch : true } ] ,
58+ ' no-useless-assignment' : ' warn' ,
59+ ' no-constant-binary-expression' : ' warn' ,
60+ ' react/jsx-key' : ' warn' ,
61+ ' preserve-caught-error' : ' warn' ,
62+ ' react/prop-types' : ' off' ,
63+ ' react/no-unescaped-entities' : ' off' ,
64+ ' react/display-name' : ' off' ,
6565} ;
6666
6767const tsRules = {
6868 // Keep CI green while we gradually clean up the repo.
69- " @typescript-eslint/no-unused-vars" : [
70- " warn" ,
69+ ' @typescript-eslint/no-unused-vars' : [
70+ ' warn' ,
7171 {
72- args : " after-used" ,
73- argsIgnorePattern : "^_" ,
74- varsIgnorePattern : "^_" ,
75- caughtErrors : " all" ,
76- caughtErrorsIgnorePattern : "^_" ,
72+ args : ' after-used' ,
73+ argsIgnorePattern : '^_' ,
74+ varsIgnorePattern : '^_' ,
75+ caughtErrors : ' all' ,
76+ caughtErrorsIgnorePattern : '^_' ,
7777 ignoreRestSiblings : true ,
7878 } ,
7979 ] ,
80- " @typescript-eslint/no-unused-expressions" : [
81- " warn" ,
80+ ' @typescript-eslint/no-unused-expressions' : [
81+ ' warn' ,
8282 { allowShortCircuit : true , allowTernary : true , allowTaggedTemplates : true } ,
8383 ] ,
84- " @typescript-eslint/no-empty-object-type" : " warn" ,
85- " @typescript-eslint/ban-ts-comment" : " warn" ,
84+ ' @typescript-eslint/no-empty-object-type' : ' warn' ,
85+ ' @typescript-eslint/ban-ts-comment' : ' warn' ,
8686
87- " @typescript-eslint/explicit-function-return-type" : " off" ,
88- " @typescript-eslint/explicit-module-boundary-types" : " off" ,
89- " @typescript-eslint/no-explicit-any" : " off" ,
90- " @typescript-eslint/no-empty-function" : " off" ,
91- " @typescript-eslint/no-non-null-assertion" : " off" ,
87+ ' @typescript-eslint/explicit-function-return-type' : ' off' ,
88+ ' @typescript-eslint/explicit-module-boundary-types' : ' off' ,
89+ ' @typescript-eslint/no-explicit-any' : ' off' ,
90+ ' @typescript-eslint/no-empty-function' : ' off' ,
91+ ' @typescript-eslint/no-non-null-assertion' : ' off' ,
9292} ;
9393
9494module . exports = defineConfig ( [
9595 // JS / JSX
9696 {
97- files : [ " **/*.{js,jsx,cjs,mjs}" ] ,
98- ignores : [ " eslint.config.js" , " .eslintrc.js" ] ,
97+ files : [ ' **/*.{js,jsx,cjs,mjs}' ] ,
98+ ignores : [ ' eslint.config.js' , ' .eslintrc.js' ] ,
9999 languageOptions : {
100100 globals : {
101101 ...globals . browser ,
102102 ...globals . node ,
103- Atomics : " readonly" ,
104- SharedArrayBuffer : " readonly" ,
103+ Atomics : ' readonly' ,
104+ SharedArrayBuffer : ' readonly' ,
105105 } ,
106- ecmaVersion : " latest" ,
107- sourceType : " module" ,
106+ ecmaVersion : ' latest' ,
107+ sourceType : ' module' ,
108108 } ,
109109 extends : fixupConfigRules (
110110 compat . extends (
111- " eslint:recommended" ,
112- " plugin:react/recommended" ,
113- " plugin:react/jsx-runtime" ,
114- " plugin:import/errors" ,
115- " plugin:import/warnings" ,
116- " prettier" ,
117- ) ,
111+ ' eslint:recommended' ,
112+ ' plugin:react/recommended' ,
113+ ' plugin:react/jsx-runtime' ,
114+ ' plugin:import/errors' ,
115+ ' plugin:import/warnings' ,
116+ ' prettier'
117+ )
118118 ) ,
119119 plugins : {
120120 promise,
@@ -127,34 +127,34 @@ module.exports = defineConfig([
127127
128128 // TS / TSX
129129 {
130- files : [ " **/*.{ts,tsx}" ] ,
130+ files : [ ' **/*.{ts,tsx}' ] ,
131131 languageOptions : {
132132 globals : {
133133 ...globals . browser ,
134134 ...globals . node ,
135- Atomics : " readonly" ,
136- SharedArrayBuffer : " readonly" ,
135+ Atomics : ' readonly' ,
136+ SharedArrayBuffer : ' readonly' ,
137137 } ,
138138 parser : tsParser ,
139- ecmaVersion : " latest" ,
140- sourceType : " module" ,
139+ ecmaVersion : ' latest' ,
140+ sourceType : ' module' ,
141141 parserOptions : { } ,
142142 } ,
143143 extends : fixupConfigRules (
144144 compat . extends (
145- " eslint:recommended" ,
146- " plugin:@typescript-eslint/recommended" ,
147- " plugin:react/recommended" ,
148- " plugin:react/jsx-runtime" ,
149- " plugin:import/errors" ,
150- " plugin:import/warnings" ,
151- " plugin:import/typescript" ,
152- " prettier" ,
153- ) ,
145+ ' eslint:recommended' ,
146+ ' plugin:@typescript-eslint/recommended' ,
147+ ' plugin:react/recommended' ,
148+ ' plugin:react/jsx-runtime' ,
149+ ' plugin:import/errors' ,
150+ ' plugin:import/warnings' ,
151+ ' plugin:import/typescript' ,
152+ ' prettier'
153+ )
154154 ) ,
155155 plugins : {
156156 promise,
157- " @typescript-eslint" : fixupPluginRules ( typescriptEslint ) ,
157+ ' @typescript-eslint' : fixupPluginRules ( typescriptEslint ) ,
158158 import : fixupPluginRules ( _import ) ,
159159 react : fixupPluginRules ( react ) ,
160160 } ,
@@ -163,11 +163,11 @@ module.exports = defineConfig([
163163 } ,
164164
165165 globalIgnores ( [
166- " **/node_modules/**" ,
167- " **/dist/**" ,
168- " **/build/**" ,
169- " **/tests/**" ,
170- " eslint.config.js" ,
171- " .eslintrc.js" ,
166+ ' **/node_modules/**' ,
167+ ' **/dist/**' ,
168+ ' **/build/**' ,
169+ ' **/tests/**' ,
170+ ' eslint.config.js' ,
171+ ' .eslintrc.js' ,
172172 ] ) ,
173173] ) ;
0 commit comments