forked from sirDonovan/Lanette
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
200 lines (166 loc) · 6.59 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
module.exports = {
root: true,
plugins: [
'@typescript-eslint',
],
env: {
node: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
reportUnusedDisableDirectives: true,
parserOptions: {
sourceType: 'module',
project: [
'./tsconfig.json',
],
allowAutomaticSingleRunInference: true,
tsconfigRootDir: __dirname,
warnOnUnsupportedTypeScriptVersion: false,
},
parser: '@typescript-eslint/parser',
rules: {
'no-trailing-spaces': 'error',
'max-len': ['error', {
'code': 140,
'ignoreComments': true
}],
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/prefer-regexp-exec': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/array-type': ['error', {
'default': 'array'
}],
'@typescript-eslint/ban-ts-comment': ['error', {
'ts-ignore': false,
'ts-expect-error': false,
'ts-nocheck': true,
'ts-check': true
}],
'@typescript-eslint/ban-tslint-comment': 'error',
'brace-style': 'off',
'@typescript-eslint/brace-style': ['error', '1tbs'],
'@typescript-eslint/class-literal-property-style': ['error', 'fields'],
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': ['error', {
'arrays': 'always-multiline',
'objects': 'always-multiline',
'imports': 'never',
'exports': 'never',
'functions': 'never'
}],
'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': 'error',
'@typescript-eslint/consistent-type-assertions': ['error', {
'assertionStyle': 'as',
'objectLiteralTypeAssertions': 'never'
}],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/consistent-type-imports': ['error', {
'prefer': 'type-imports',
'disallowTypeAnnotations': false
}],
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'error',
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': ["error", {"before": true, "after": true}],
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': ['error', {
'exceptAfterSingleLine': true
}],
'@typescript-eslint/member-ordering': ['error', {
'default': {
'memberTypes': [
// Index signature
'signature',
// Fields
'public-abstract-field',
'protected-abstract-field',
'public-static-field',
'protected-static-field',
'private-static-field',
'public-instance-field',
'protected-instance-field',
'private-instance-field',
// Constructors
'public-constructor',
'protected-constructor',
'private-constructor',
// Methods
'public-abstract-method',
'protected-abstract-method',
'public-static-method',
'protected-static-method',
'private-static-method',
'public-instance-method',
'protected-instance-method',
'private-instance-method'
],
'order': 'as-written'
}
}],
'@typescript-eslint/method-signature-style': 'error',
'@typescript-eslint/naming-convention': ['error', {
'selector': 'variableLike',
'format': ['camelCase', 'UPPER_CASE'],
'leadingUnderscore': 'forbid',
'trailingUnderscore': 'forbid'
}, {
'selector': 'typeLike',
'format': ['PascalCase'],
'leadingUnderscore': 'forbid',
'trailingUnderscore': 'forbid'
}, {
'selector': 'interface',
'format': ['PascalCase'],
'leadingUnderscore': 'forbid',
'trailingUnderscore': 'forbid',
'prefix': ['I']
}],
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': 'error',
'no-duplicate-imports': 'off',
'@typescript-eslint/no-duplicate-imports': 'error',
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': ['error', 'all', {
'nestedBinaryExpressions': false
}],
'@typescript-eslint/no-extra-semi': 'error',
'no-invalid-this': 'off',
'@typescript-eslint/no-invalid-this': 'error',
'@typescript-eslint/no-invalid-void-type': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-throw-literal': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/promise-function-async': 'error',
'semi': 'off',
'@typescript-eslint/semi': ['error', 'always'],
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': ['error', 'never'],
'space-infix-ops': 'off',
'@typescript-eslint/space-infix-ops': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
}
}