1- const {
2- defineConfig,
3- globalIgnores,
4- } = require ( "eslint/config" ) ;
5-
61const globals = require ( "globals" ) ;
72const babelParser = require ( "@babel/eslint-parser" ) ;
83const react = require ( "eslint-plugin-react" ) ;
@@ -18,121 +13,125 @@ const compat = new FlatCompat({
1813 allConfig : js . configs . all
1914} ) ;
2015
21- module . exports = defineConfig ( [ {
22- languageOptions : {
23- globals : {
24- ...globals . browser ,
25- ...globals . node ,
26- ...globals . amd ,
27- } ,
28-
29- parser : babelParser ,
30- "ecmaVersion" : 2018 ,
31- "sourceType" : "module" ,
32-
33- parserOptions : {
34- "ecmaFeatures" : {
35- "jsx" : true ,
16+ module . exports = [
17+ ...compat . extends ( "eslint:recommended" , "plugin:react/recommended" ) ,
18+ {
19+ languageOptions : {
20+ globals : {
21+ ...globals . browser ,
22+ ...globals . node ,
23+ ...globals . amd ,
3624 } ,
37- } ,
38- } ,
3925
40- "settings" : {
41- "react" : {
42- "version" : "detect" ,
43- } ,
44- } ,
26+ parser : babelParser ,
27+ "ecmaVersion" : 2018 ,
28+ "sourceType" : "module" ,
4529
46- extends : compat . extends ( "eslint:recommended" , "plugin:react/recommended" ) ,
47-
48- plugins : {
49- react,
50- } ,
51-
52- "rules" : {
53- "array-bracket-spacing" : [ "error" , "never" ] ,
54- "comma-style" : [ "error" ] ,
55-
56- "arrow-spacing" : [ "error" , {
57- "after" : true ,
58- "before" : true ,
59- } ] ,
60-
61- "block-scoped-var" : "error" ,
62- "block-spacing" : "error" ,
63- "brace-style" : [ "error" , "1tbs" ] ,
64- "jsx-quotes" : [ "error" , "prefer-double" ] ,
65- "keyword-spacing" : "error" ,
66-
67- "key-spacing" : [ "error" , {
68- "beforeColon" : false ,
69- "afterColon" : true ,
70- } ] ,
71-
72- "no-unused-vars" : [ "warn" , {
73- "varsIgnorePattern" : "React" ,
74- } ] ,
75-
76- "no-trailing-spaces" : "error" ,
77- "object-curly-spacing" : [ "error" , "always" ] ,
78- "react/display-name" : 0 ,
79- "react/prop-types" : 0 ,
80- "react/no-unescaped-entities" : [ 0 ] ,
81- "react/jsx-no-duplicate-props" : [ 0 ] ,
82-
83- "indent" : [ "error" , 2 , {
84- "FunctionExpression" : {
85- "parameters" : "first" ,
86- } ,
87-
88- "FunctionDeclaration" : {
89- "parameters" : "first" ,
30+ parserOptions : {
31+ "ecmaFeatures" : {
32+ "jsx" : true ,
33+ } ,
9034 } ,
35+ } ,
9136
92- "MemberExpression" : 1 ,
93- "SwitchCase" : 1 ,
94- "outerIIFEBody" : 0 ,
95-
96- "VariableDeclarator" : {
97- "var" : 2 ,
98- "let" : 2 ,
99- "const" : 3 ,
37+ "settings" : {
38+ "react" : {
39+ "version" : "detect" ,
10040 } ,
41+ } ,
10142
102- ignoredNodes : [ "TemplateLiteral" ] ,
103- } ] ,
104-
105- "linebreak-style" : [ "error" , "unix" ] ,
106- "quotes" : [ "error" , "double" ] ,
107- "semi" : [ "error" , "always" ] ,
108- "strict" : 0 ,
109- "valid-typeof" : 0 ,
110-
111- "space-unary-ops" : [ 1 , {
112- "words" : true ,
113- "nonwords" : false ,
114- } ] ,
43+ plugins : {
44+ react,
45+ } ,
11546
116- "space-infix-ops" : [ "error" ] ,
47+ "rules" : {
48+ "array-bracket-spacing" : [ "error" , "never" ] ,
49+ "comma-style" : [ "error" ] ,
50+
51+ "arrow-spacing" : [ "error" , {
52+ "after" : true ,
53+ "before" : true ,
54+ } ] ,
55+
56+ "block-scoped-var" : "error" ,
57+ "block-spacing" : "error" ,
58+ "brace-style" : [ "error" , "1tbs" ] ,
59+ "jsx-quotes" : [ "error" , "prefer-double" ] ,
60+ "keyword-spacing" : "error" ,
61+
62+ "key-spacing" : [ "error" , {
63+ "beforeColon" : false ,
64+ "afterColon" : true ,
65+ } ] ,
66+
67+ "no-unused-vars" : [ "warn" , {
68+ "varsIgnorePattern" : "React" ,
69+ } ] ,
70+
71+ "no-trailing-spaces" : "error" ,
72+ "object-curly-spacing" : [ "error" , "always" ] ,
73+ "react/display-name" : 0 ,
74+ "react/prop-types" : 0 ,
75+ "react/no-unescaped-entities" : [ 0 ] ,
76+ "react/jsx-no-duplicate-props" : [ 0 ] ,
77+
78+ "indent" : [ "error" , 2 , {
79+ "FunctionExpression" : {
80+ "parameters" : "first" ,
81+ } ,
82+
83+ "FunctionDeclaration" : {
84+ "parameters" : "first" ,
85+ } ,
86+
87+ "MemberExpression" : 1 ,
88+ "SwitchCase" : 1 ,
89+ "outerIIFEBody" : 0 ,
90+
91+ "VariableDeclarator" : {
92+ "var" : 2 ,
93+ "let" : 2 ,
94+ "const" : 3 ,
95+ } ,
96+
97+ ignoredNodes : [ "TemplateLiteral" ] ,
98+ } ] ,
99+
100+ "linebreak-style" : [ "error" , "unix" ] ,
101+ "quotes" : [ "error" , "double" ] ,
102+ "semi" : [ "error" , "always" ] ,
103+ "strict" : 0 ,
104+ "valid-typeof" : 0 ,
105+
106+ "space-unary-ops" : [ 1 , {
107+ "words" : true ,
108+ "nonwords" : false ,
109+ } ] ,
110+
111+ "space-infix-ops" : [ "error" ] ,
112+ } ,
117113 } ,
118- } , globalIgnores ( [
119- "**/node_modules/" ,
120- "**/*.test.js" ,
121- "src/utils/" ,
122- "**/.cache/" ,
123- "**/.github/" ,
124- "**/assets/" ,
125- "**/public/" ,
126- "**/.babelrc" ,
127- "**/.env.development" ,
128- "**/CNAME" ,
129- "**/CODE_OF_CONDUCT.md" ,
130- "**/CODEOWNERS" ,
131- "**/font-preload-cache.json" ,
132- "**/LICENSE" ,
133- "**/Makefile" ,
134- "**/README.md" ,
135- "**/package.json" ,
136- "**/package-lock.json" ,
137- "**/static/" ,
138- ] ) ] ) ;
114+ {
115+ ignores : [
116+ "**/node_modules/" ,
117+ "**/*.test.js" ,
118+ "src/utils/" ,
119+ "**/.cache/" ,
120+ "**/.github/" ,
121+ "**/assets/" ,
122+ "**/public/" ,
123+ "**/.babelrc" ,
124+ "**/.env.development" ,
125+ "**/CNAME" ,
126+ "**/CODE_OF_CONDUCT.md" ,
127+ "**/CODEOWNERS" ,
128+ "**/font-preload-cache.json" ,
129+ "**/LICENSE" ,
130+ "**/Makefile" ,
131+ "**/README.md" ,
132+ "**/package.json" ,
133+ "**/package-lock.json" ,
134+ "**/static/" ,
135+ ]
136+ }
137+ ] ;
0 commit comments