@@ -5,162 +5,163 @@ module.exports = {
55 typescript : { } ,
66 } ,
77 } ,
8- parser : '@typescript-eslint/parser' ,
9- parserOptions : {
10- ecmaVersion : 2018 ,
11- sourceType : 'module' ,
12- project : './tsconfig.json' ,
13- // TODO: Remove this property in the future
14- createDefaultProgram : true ,
15- } ,
16- plugins : [ '@typescript-eslint' ] ,
178 env : {
189 es6 : true ,
1910 } ,
20- rules : {
21- //
22- // Does Not Work Well With Eslint
23- //
24- 'valid-jsdoc' : 'off' ,
25- 'no-undef' : 'off' ,
26- 'no-unused-vars' : 'off' ,
27- //
28- // General rules
29- //
30- '@typescript-eslint/adjacent-overload-signatures' : 'error' ,
31- '@typescript-eslint/array-type' : [
32- 'error' ,
33- {
34- default : 'array' ,
35- readonly : 'array' ,
36- } ,
37- ] ,
38- '@typescript-eslint/await-thenable' : 'error' ,
39- '@typescript-eslint/brace-style' : 'error' ,
40- '@typescript-eslint/consistent-type-assertions' : 'error' ,
41- '@typescript-eslint/consistent-type-definitions' : [ 'error' , 'interface' ] ,
42- '@typescript-eslint/explicit-function-return-type' : 0 ,
43- '@typescript-eslint/explicit-member-accessibility' : 0 ,
44- '@typescript-eslint/interface-name-prefix' : 0 ,
45- '@typescript-eslint/member-delimiter-style' : [
46- 'error' ,
47- {
48- multiline : {
49- delimiter : 'none' ,
50- } ,
51- singleline : {
52- delimiter : 'semi' ,
53- } ,
54- } ,
55- ] ,
56- '@typescript-eslint/member-ordering' : 0 ,
57- '@typescript-eslint/no-array-constructor' : 'error' ,
58- '@typescript-eslint/no-dynamic-delete' : 'error' ,
59- '@typescript-eslint/no-empty-function' : 'error' ,
60- '@typescript-eslint/no-empty-interface' : 'error' ,
61- '@typescript-eslint/no-explicit-any' : 0 ,
62- '@typescript-eslint/no-extra-non-null-assertion' : 'warn' ,
63- '@typescript-eslint/no-extra-parens' : 0 ,
64- '@typescript-eslint/no-extraneous-class' : 0 ,
65- '@typescript-eslint/no-floating-promises' : 'error' ,
66- '@typescript-eslint/no-for-in-array' : 'error' ,
67- '@typescript-eslint/no-inferrable-types' : 'error' ,
68- '@typescript-eslint/no-magic-numbers' : 0 ,
69- '@typescript-eslint/no-misused-new' : 'error' ,
70- '@typescript-eslint/no-misused-promises' : 'error' ,
71- '@typescript-eslint/no-namespace' : 'error' ,
72- '@typescript-eslint/no-non-null-assertion' : 1 ,
73- '@typescript-eslint/no-parameter-properties' : 0 ,
74- '@typescript-eslint/no-require-imports' : 1 ,
75- '@typescript-eslint/no-this-alias' : [
76- 'error' ,
77- {
78- allowDestructuring : true ,
79- } ,
80- ] ,
81- '@typescript-eslint/no-type-alias' : 0 ,
82- '@typescript-eslint/no-unnecessary-condition' : 0 ,
83- '@typescript-eslint/no-unnecessary-qualifier' : 'error' ,
84- '@typescript-eslint/no-unnecessary-type-arguments' : 'error' ,
85- '@typescript-eslint/no-unnecessary-type-assertion' : 0 , // TODO: this doesn't work with enums correctly 😢
86- '@typescript-eslint/no-untyped-public-signature' : 0 ,
87- 'no-use-before-define' : 0 ,
88- '@typescript-eslint/no-use-before-define' : [
89- 'error' ,
90- {
91- functions : false ,
92- classes : false ,
93- typedefs : false ,
94- } ,
95- ] ,
96- '@typescript-eslint/no-useless-constructor' : 'error' ,
97- '@typescript-eslint/no-var-requires' : 'error' ,
98- '@typescript-eslint/prefer-for-of' : 'error' ,
99- '@typescript-eslint/prefer-function-type' : 'error' ,
100- '@typescript-eslint/prefer-includes' : 'error' ,
101- '@typescript-eslint/prefer-namespace-keyword' : 'error' ,
102- '@typescript-eslint/prefer-nullish-coalescing' : 0 ,
103- '@typescript-eslint/prefer-optional-chain' : 'error' ,
104- '@typescript-eslint/prefer-readonly' : 'error' ,
105- '@typescript-eslint/prefer-regexp-exec' : 'error' ,
106- '@typescript-eslint/prefer-string-starts-ends-with' : 'error' ,
107- '@typescript-eslint/promise-function-async' : 0 ,
108- '@typescript-eslint/quotes' : [ 'error' , 'single' , 'avoid-escape' ] ,
109- '@typescript-eslint/require-array-sort-compare' : 'error' ,
110- '@typescript-eslint/require-await' : 'error' ,
111- '@typescript-eslint/restrict-plus-operands' : 'error' ,
112- '@typescript-eslint/restrict-template-expressions' : 0 ,
113- '@typescript-eslint/semi' : [ 'error' , 'never' ] ,
114- '@typescript-eslint/space-before-function-paren' : 0 ,
115- '@typescript-eslint/triple-slash-reference' : 'error' ,
116- '@typescript-eslint/typedef' : 1 ,
117- '@typescript-eslint/type-annotation-spacing' : 'error' ,
118- '@typescript-eslint/unbound-method' : 0 ,
119- '@typescript-eslint/unified-signatures' : 'error' ,
120- '@typescript-eslint/naming-convention' : [
121- 'error' ,
122- {
123- selector : 'memberLike' ,
124- modifiers : [ 'private' ] ,
125- format : [ 'camelCase' ] ,
126- leadingUnderscore : 'forbid' ,
127- } ,
128- {
129- selector : 'variable' ,
130- types : [ 'boolean' ] ,
131- format : [ 'PascalCase' ] ,
132- prefix : [ 'is' , 'should' , 'has' , 'can' , 'did' , 'will' , 'expected' ] ,
133- } ,
134- {
135- selector : 'typeParameter' ,
136- format : [ 'PascalCase' ] ,
137- custom : {
138- regex : 'T[A-Z][a-zA-Z]+$' ,
139- match : true ,
140- } ,
141- } ,
142- {
143- selector : 'interface' ,
144- format : [ 'PascalCase' ] ,
145- custom : {
146- regex : '^I[A-Z]' ,
147- match : true ,
148- } ,
11+ overrides : [
12+ {
13+ files : [ '**/*.ts' , '**/*.tsx' ] ,
14+ parser : '@typescript-eslint/parser' ,
15+ parserOptions : {
16+ ecmaVersion : 2018 ,
17+ sourceType : 'module' ,
18+ project : './tsconfig.json' ,
19+ // TODO: Remove this property in the future
20+ createDefaultProgram : true ,
14921 } ,
150- ] ,
151- 'no-shadow' : 0 ,
152- '@typescript-eslint/no-shadow' : 2 ,
153- '@typescript-eslint/no-unused-vars' : [
154- 2 ,
155- {
156- vars : 'all' ,
157- args : 'after-used' ,
158- ignoreRestSiblings : true ,
159- varsIgnorePattern : '^_' ,
22+ plugins : [ '@typescript-eslint' ] ,
23+ rules : {
24+ // TypeScript-specific rules
25+ 'valid-jsdoc' : 'off' ,
26+ 'no-undef' : 'off' ,
27+ 'no-unused-vars' : 'off' ,
28+ '@typescript-eslint/adjacent-overload-signatures' : 'error' ,
29+ '@typescript-eslint/array-type' : [
30+ 'error' ,
31+ {
32+ default : 'array' ,
33+ readonly : 'array' ,
34+ } ,
35+ ] ,
36+ '@typescript-eslint/await-thenable' : 'error' ,
37+ '@typescript-eslint/brace-style' : 'error' ,
38+ '@typescript-eslint/consistent-type-assertions' : 'error' ,
39+ '@typescript-eslint/consistent-type-definitions' : [
40+ 'error' ,
41+ 'interface' ,
42+ ] ,
43+ '@typescript-eslint/explicit-function-return-type' : 0 ,
44+ '@typescript-eslint/explicit-member-accessibility' : 0 ,
45+ '@typescript-eslint/interface-name-prefix' : 0 ,
46+ '@typescript-eslint/member-delimiter-style' : [
47+ 'error' ,
48+ {
49+ multiline : {
50+ delimiter : 'none' ,
51+ } ,
52+ singleline : {
53+ delimiter : 'semi' ,
54+ } ,
55+ } ,
56+ ] ,
57+ '@typescript-eslint/member-ordering' : 0 ,
58+ '@typescript-eslint/no-array-constructor' : 'error' ,
59+ '@typescript-eslint/no-dynamic-delete' : 'error' ,
60+ '@typescript-eslint/no-empty-function' : 'error' ,
61+ '@typescript-eslint/no-empty-interface' : 'error' ,
62+ '@typescript-eslint/no-explicit-any' : 0 ,
63+ '@typescript-eslint/no-extra-non-null-assertion' : 'warn' ,
64+ '@typescript-eslint/no-extra-parens' : 0 ,
65+ '@typescript-eslint/no-extraneous-class' : 0 ,
66+ '@typescript-eslint/no-floating-promises' : 'error' ,
67+ '@typescript-eslint/no-for-in-array' : 'error' ,
68+ '@typescript-eslint/no-inferrable-types' : 'error' ,
69+ '@typescript-eslint/no-magic-numbers' : 0 ,
70+ '@typescript-eslint/no-misused-new' : 'error' ,
71+ '@typescript-eslint/no-misused-promises' : 'error' ,
72+ '@typescript-eslint/no-namespace' : 'error' ,
73+ '@typescript-eslint/no-non-null-assertion' : 1 ,
74+ '@typescript-eslint/no-parameter-properties' : 0 ,
75+ '@typescript-eslint/no-require-imports' : 1 ,
76+ '@typescript-eslint/no-this-alias' : [
77+ 'error' ,
78+ {
79+ allowDestructuring : true ,
80+ } ,
81+ ] ,
82+ '@typescript-eslint/no-type-alias' : 0 ,
83+ '@typescript-eslint/no-unnecessary-condition' : 0 ,
84+ '@typescript-eslint/no-unnecessary-qualifier' : 'error' ,
85+ '@typescript-eslint/no-unnecessary-type-arguments' : 'error' ,
86+ '@typescript-eslint/no-unnecessary-type-assertion' : 0 ,
87+ '@typescript-eslint/no-untyped-public-signature' : 0 ,
88+ 'no-use-before-define' : 0 ,
89+ '@typescript-eslint/no-use-before-define' : [
90+ 'error' ,
91+ {
92+ functions : false ,
93+ classes : false ,
94+ typedefs : false ,
95+ } ,
96+ ] ,
97+ '@typescript-eslint/no-useless-constructor' : 'error' ,
98+ '@typescript-eslint/no-var-requires' : 'error' ,
99+ '@typescript-eslint/prefer-for-of' : 'error' ,
100+ '@typescript-eslint/prefer-function-type' : 'error' ,
101+ '@typescript-eslint/prefer-includes' : 'error' ,
102+ '@typescript-eslint/prefer-namespace-keyword' : 'error' ,
103+ '@typescript-eslint/prefer-nullish-coalescing' : 0 ,
104+ '@typescript-eslint/prefer-optional-chain' : 'error' ,
105+ '@typescript-eslint/prefer-readonly' : 'error' ,
106+ '@typescript-eslint/prefer-regexp-exec' : 'error' ,
107+ '@typescript-eslint/prefer-string-starts-ends-with' : 'error' ,
108+ '@typescript-eslint/promise-function-async' : 0 ,
109+ '@typescript-eslint/quotes' : [ 'error' , 'single' , 'avoid-escape' ] ,
110+ '@typescript-eslint/require-array-sort-compare' : 'error' ,
111+ '@typescript-eslint/require-await' : 'error' ,
112+ '@typescript-eslint/restrict-plus-operands' : 'error' ,
113+ '@typescript-eslint/restrict-template-expressions' : 0 ,
114+ '@typescript-eslint/semi' : [ 'error' , 'never' ] ,
115+ '@typescript-eslint/space-before-function-paren' : 0 ,
116+ '@typescript-eslint/triple-slash-reference' : 'error' ,
117+ '@typescript-eslint/typedef' : 1 ,
118+ '@typescript-eslint/type-annotation-spacing' : 'error' ,
119+ '@typescript-eslint/unbound-method' : 0 ,
120+ '@typescript-eslint/unified-signatures' : 'error' ,
121+ '@typescript-eslint/naming-convention' : [
122+ 'error' ,
123+ {
124+ selector : 'memberLike' ,
125+ modifiers : [ 'private' ] ,
126+ format : [ 'camelCase' ] ,
127+ leadingUnderscore : 'forbid' ,
128+ } ,
129+ {
130+ selector : 'variable' ,
131+ types : [ 'boolean' ] ,
132+ format : [ 'PascalCase' ] ,
133+ prefix : [ 'is' , 'should' , 'has' , 'can' , 'did' , 'will' , 'expected' ] ,
134+ } ,
135+ {
136+ selector : 'typeParameter' ,
137+ format : [ 'PascalCase' ] ,
138+ custom : {
139+ regex : 'T[A-Z][a-zA-Z]+$' ,
140+ match : true ,
141+ } ,
142+ } ,
143+ {
144+ selector : 'interface' ,
145+ format : [ 'PascalCase' ] ,
146+ custom : {
147+ regex : '^I[A-Z]' ,
148+ match : true ,
149+ } ,
150+ } ,
151+ ] ,
152+ 'no-shadow' : 0 ,
153+ '@typescript-eslint/no-shadow' : 2 ,
154+ '@typescript-eslint/no-unused-vars' : [
155+ 2 ,
156+ {
157+ vars : 'all' ,
158+ args : 'after-used' ,
159+ ignoreRestSiblings : true ,
160+ varsIgnorePattern : '^_' ,
161+ } ,
162+ ] ,
160163 } ,
161- ] ,
162- } ,
163- overrides : [
164+ } ,
164165 // Storybook
165166 {
166167 files : [ '*.stories.ts' ] ,
0 commit comments