1- module . exports = {
2- env : {
3- browser : true ,
4- es6 : true ,
5- node : true
1+ import globals from 'globals' ;
2+ import tsParser from '@typescript-eslint/parser' ;
3+ import pluginReact from 'eslint-plugin-react' ;
4+ import typescriptEslint from '@typescript-eslint/eslint-plugin' ;
5+
6+ export default [ {
7+ ignores : [ '**/build' , '**/eslintrc.js' , '**/public' , '**/scripts' ]
8+ } ,
9+ {
10+ plugins : {
11+ pluginReact,
12+ '@typescript-eslint' : typescriptEslint
613 } ,
7- extends : [
8- 'eslint:recommended' ,
9- 'plugin:react/recommended' ,
10- 'plugin:@typescript-eslint/eslint-recommended'
11- ] ,
12- globals : {
13- Atomics : 'readonly' ,
14- SharedArrayBuffer : 'readonly'
15- } ,
16- parser : '@typescript-eslint/parser' ,
17- parserOptions : {
18- project : 'tsconfig.json' ,
19- createDefaultProgram : true ,
14+
15+ files : [ '**/*.{js,mjs,cjs,ts,jsx,tsx}' ] ,
16+
17+ languageOptions : {
18+ globals : {
19+ ... globals . browser ,
20+ ... globals . node ,
21+ ... globals . es2015 ,
22+ Atomics : 'readonly' ,
23+ SharedArrayBuffer : 'readonly'
24+ } ,
25+
26+ parser : tsParser ,
2027 ecmaVersion : 6 ,
21- sourceType : 'module'
28+ sourceType : 'module' ,
29+
30+ parserOptions : {
31+ project : 'tsconfig.json' ,
32+ createDefaultProgram : true
33+ }
2234 } ,
23- plugins : [ 'react' , '@typescript-eslint' ] ,
35+
36+ settings : {
37+ react : {
38+ version : 'detect'
39+ }
40+ } ,
41+
2442 rules : {
2543 '@typescript-eslint/adjacent-overload-signatures' : 'error' ,
2644 '@typescript-eslint/array-type' : 'warn' ,
2745 '@typescript-eslint/ban-types' : 'off' ,
2846 '@typescript-eslint/consistent-type-assertions' : 'error' ,
2947 '@typescript-eslint/consistent-type-definitions' : 'error' ,
30- '@typescript-eslint/explicit-member-accessibility' : [
31- 'off' ,
32- {
33- accessibility : 'explicit'
34- }
35- ] ,
36- 'indent' : [ 'error' , 2 ] ,
48+
49+ '@typescript-eslint/explicit-member-accessibility' : [ 'off' , {
50+ accessibility : 'explicit'
51+ } ] ,
52+
53+ indent : [ 'error' , 2 ] ,
3754 '@typescript-eslint/interface-name-prefix' : 'off' ,
38- '@typescript-eslint/member-delimiter-style' : [
39- 'off' ,
40- {
41- multiline : {
42- delimiter : 'none' ,
43- requireLast : true
44- } ,
45- singleline : {
46- delimiter : 'semi' ,
47- requireLast : false
48- }
55+
56+ '@typescript-eslint/member-delimiter-style' : [ 'off' , {
57+ multiline : {
58+ delimiter : 'none' ,
59+ requireLast : true
60+ } ,
61+
62+ singleline : {
63+ delimiter : 'semi' ,
64+ requireLast : false
4965 }
50- ] ,
66+ } ] ,
67+
5168 '@typescript-eslint/member-ordering' : 'off' ,
5269 '@typescript-eslint/no-empty-function' : 'error' ,
5370 '@typescript-eslint/no-empty-interface' : 'error' ,
@@ -59,21 +76,18 @@ module.exports = {
5976 '@typescript-eslint/no-misused-new' : 'error' ,
6077 '@typescript-eslint/no-namespace' : 'off' ,
6178 '@typescript-eslint/no-parameter-properties' : 'off' ,
62- '@typescript-eslint/no-unused-expressions' : [
63- 'error' ,
64- {
65- allowShortCircuit : true
66- }
67- ] ,
68- '@typescript-eslint/no-unused-vars' : [
69- 'warn' ,
70- {
71- args : 'after-used' ,
72- argsIgnorePattern : '^_' ,
73- ignoreRestSiblings : false ,
74- vars : 'all'
75- }
76- ] ,
79+
80+ '@typescript-eslint/no-unused-expressions' : [ 'error' , {
81+ allowShortCircuit : true
82+ } ] ,
83+
84+ '@typescript-eslint/no-unused-vars' : [ 'warn' , {
85+ args : 'after-used' ,
86+ argsIgnorePattern : '^_' ,
87+ ignoreRestSiblings : false ,
88+ vars : 'all'
89+ } ] ,
90+
7791 '@typescript-eslint/no-use-before-define' : 'off' ,
7892 '@typescript-eslint/no-var-requires' : 'off' ,
7993 '@typescript-eslint/prefer-for-of' : 'error' ,
@@ -102,7 +116,11 @@ module.exports = {
102116 'import/order' : 'off' ,
103117 'linebreak-style' : 'off' ,
104118 'max-classes-per-file' : [ 'error' , 1 ] ,
105- 'max-len' : [ 'error' , { 'code' : 120 } ] ,
119+
120+ 'max-len' : [ 'error' , {
121+ code : 120
122+ } ] ,
123+
106124 'new-parens' : 'off' ,
107125 'newline-per-chained-call' : 'off' ,
108126 'no-bitwise' : 'error' ,
@@ -120,14 +138,13 @@ module.exports = {
120138 'no-irregular-whitespace' : 'warn' ,
121139 'no-multiple-empty-lines' : 'error' ,
122140 'no-new-wrappers' : 'error' ,
123- ' quotes' : [ 'error' , 'single' ] ,
141+ quotes : [ 'error' , 'single' ] ,
124142 'no-shadow' : 'off' ,
125- '@typescript-eslint/no-shadow' : [
126- 'warn' ,
127- {
128- hoist : 'all'
129- }
130- ] ,
143+
144+ '@typescript-eslint/no-shadow' : [ 'warn' , {
145+ hoist : 'all'
146+ } ] ,
147+
131148 'no-throw-literal' : 'error' ,
132149 'no-trailing-spaces' : 'warn' ,
133150 'no-undef-init' : 'error' ,
@@ -144,22 +161,20 @@ module.exports = {
144161 radix : 'error' ,
145162 'react/no-unescaped-entities' : 0 ,
146163 'react/prop-types' : 0 ,
164+
147165 'space-before-function-paren' : [ 'error' , {
148- ' anonymous' : 'always' ,
149- ' named' : 'never' ,
150- ' asyncArrow' : 'always'
166+ anonymous : 'always' ,
167+ named : 'never' ,
168+ asyncArrow : 'always'
151169 } ] ,
170+
152171 'spaced-comment' : 'off' ,
153172 'use-isnan' : 'error' ,
154173 'valid-typeof' : 'off' ,
155174 'react/react-in-jsx-scope' : 'off' ,
156- 'react/no-unstable-nested-components' : [
157- 'off' , { 'allowAsProps' : true }
158- ]
159- } ,
160- settings : {
161- react : {
162- version : 'detect'
163- }
175+
176+ 'react/no-unstable-nested-components' : [ 'off' , {
177+ allowAsProps : true
178+ } ]
164179 }
165- } ;
180+ } ] ;
0 commit comments