11'use strict' ;
22module . exports = {
3- parser : 'typescript-eslint- parser' ,
3+ parser : '@ typescript-eslint/ parser' ,
44 plugins : [
5- 'typescript'
5+ '@ typescript-eslint '
66 ] ,
77 settings : {
88 'import/resolver' : {
@@ -16,39 +16,124 @@ module.exports = {
1616 }
1717 } ,
1818 'import/parsers' : {
19- 'typescript-eslint- parser' : [
19+ '@ typescript-eslint/ parser' : [
2020 '.ts' ,
2121 '.tsx'
2222 ]
2323 }
2424 } ,
2525 rules : {
26- 'typescript/adjacent-overload-signatures' : 'error' ,
27- 'typescript/class-name-casing' : 'error' ,
28- 'typescript/explicit-function-return-type' : [
26+ '@typescript-eslint/adjacent-overload-signatures' : 'error' ,
27+ '@typescript-eslint/array-type' : [
28+ 'error' ,
29+ 'array'
30+ ] ,
31+ '@typescript-eslint/ban-types' : [
32+ 'error' ,
33+ {
34+ types : {
35+ String : {
36+ message : 'Use `string` instead.' ,
37+ fixWith : 'string'
38+ } ,
39+ Number : {
40+ message : 'Use `number` instead.' ,
41+ fixWith : 'number'
42+ } ,
43+ Boolean : {
44+ message : 'Use `boolean` instead.' ,
45+ fixWith : 'boolean'
46+ } ,
47+ Object : {
48+ message : 'Use `object` instead.' ,
49+ fixWith : 'object'
50+ } ,
51+ object : 'Use `{}` instead.' ,
52+ Function : 'Use a specific function type instead, like `() => void`.' ,
53+ any : {
54+ message : 'Use `unknown` instead.' ,
55+ fixWith : 'unknown'
56+ } ,
57+ // TODO: Enforce `undefined` over `null` here too?
58+ }
59+ }
60+ ] ,
61+ 'camelcase' : 'off' ,
62+ '@typescript-eslint/camelcase' : [
63+ 'error' ,
64+ {
65+ properties : 'always' ,
66+ ignoreDestructuring : false ,
67+ }
68+ ] ,
69+ '@typescript-eslint/class-name-casing' : 'error' ,
70+ '@typescript-eslint/explicit-function-return-type' : [
2971 'error' ,
3072 {
3173 allowExpressions : true
3274 }
3375 ] ,
34- 'typescript/generic-type-naming' : [
76+ '@ typescript-eslint /generic-type-naming' : [
3577 'error' ,
3678 '^[A-Z][a-zA-Z]+$'
3779 ] ,
38- 'typescript/member-delimiter-style' : 'error' ,
39- 'typescript/member-ordering' : 'error' ,
40- 'typescript/no-angle-bracket-type-assertion' : 'error' ,
41- 'typescript/no-array-constructor' : 'error' ,
42- 'typescript/no-empty-interface' : 'error' ,
43- 'typescript/no-inferrable-types' : 'error' ,
44- 'typescript/no-namespace' : 'error' ,
45- 'typescript/no-non-null-assertion' : 'error' ,
46- 'typescript/no-triple-slash-reference' : 'error' ,
47- 'typescript/no-type-alias' : 'error' ,
48- 'typescript/no-unused-vars' : 'error' ,
49- 'typescript/no-use-before-define' : 'error' ,
50- 'typescript/no-var-requires' : 'error' ,
51- 'typescript/prefer-namespace-keyword' : 'error' ,
52- 'typescript/type-annotation-spacing' : 'error'
80+ indent : 'off' ,
81+ '@typescript-eslint/indent' : [
82+ 'error' ,
83+ 'tab' ,
84+ {
85+ SwitchCase : 1
86+ }
87+ ] ,
88+ '@typescript-eslint/interface-name-prefix' : [
89+ 'error' ,
90+ 'never'
91+ ] ,
92+ '@typescript-eslint/member-delimiter-style' : [
93+ 'error' ,
94+ {
95+ multiline : {
96+ delimiter : 'semi' ,
97+ requireLast : true
98+ } ,
99+ singleline : {
100+ delimiter : 'semi' ,
101+ requireLast : true
102+ }
103+ }
104+ ] ,
105+ '@typescript-eslint/member-naming' : [
106+ 'error' ,
107+ {
108+ private : '^_'
109+ }
110+ ] ,
111+ '@typescript-eslint/member-ordering' : 'error' ,
112+ '@typescript-eslint/no-angle-bracket-type-assertion' : 'error' ,
113+ '@typescript-eslint/no-array-constructor' : 'error' ,
114+ '@typescript-eslint/no-empty-interface' : 'error' ,
115+
116+ // The `ban-types` rule handles this better
117+ // '@typescript-eslint/no-explicit-any': 'error',
118+
119+ '@typescript-eslint/no-extraneous-class' : 'error' ,
120+ '@typescript-eslint/no-inferrable-types' : 'error' ,
121+ '@typescript-eslint/no-misused-new' : 'error' ,
122+ '@typescript-eslint/no-namespace' : 'error' ,
123+ '@typescript-eslint/no-non-null-assertion' : 'error' ,
124+ '@typescript-eslint/no-object-literal-type-assertion' : 'error' ,
125+ '@typescript-eslint/no-this-alias' : [
126+ 'error' ,
127+ {
128+ allowDestructuring : true ,
129+ }
130+ ] ,
131+ '@typescript-eslint/no-triple-slash-reference' : 'error' ,
132+ '@typescript-eslint/no-type-alias' : 'error' ,
133+ '@typescript-eslint/no-unused-vars' : 'error' ,
134+ '@typescript-eslint/no-var-requires' : 'error' ,
135+ '@typescript-eslint/prefer-interface' : 'error' ,
136+ '@typescript-eslint/prefer-namespace-keyword' : 'error' ,
137+ '@typescript-eslint/type-annotation-spacing' : 'error'
53138 }
54139} ;
0 commit comments