Skip to content

Commit fc7162e

Browse files
fix: initial commit for lint migration
1 parent dafbb8a commit fc7162e

File tree

5 files changed

+37030
-7427
lines changed

5 files changed

+37030
-7427
lines changed

.eslintrc.base.js

Lines changed: 382 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,382 @@
1+
/*
2+
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
3+
https://github.com/typescript-eslint/tslint-to-eslint-config
4+
5+
It represents the closest reasonable ESLint configuration to this
6+
project's original TSLint configuration.
7+
8+
We recommend eventually switching this configuration to extend from
9+
the recommended rulesets in typescript-eslint.
10+
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
11+
12+
Happy linting! 💖
13+
*/
14+
module.exports = {
15+
env: {
16+
browser: true,
17+
node: true
18+
},
19+
extends: ['plugin:@typescript-eslint/all'],
20+
parser: '@typescript-eslint/parser',
21+
parserOptions: {
22+
project: 'tsconfig.json',
23+
sourceType: 'module'
24+
},
25+
plugins: [
26+
'eslint-plugin-unicorn',
27+
'eslint-plugin-import',
28+
'eslint-plugin-prefer-arrow',
29+
'eslint-plugin-no-null',
30+
'eslint-plugin-jsdoc',
31+
'eslint-plugin-react',
32+
'@typescript-eslint',
33+
'@typescript-eslint/tslint'
34+
],
35+
rules: {
36+
'@typescript-eslint/adjacent-overload-signatures': 'error',
37+
'@typescript-eslint/array-type': [
38+
'error',
39+
{
40+
default: 'array'
41+
}
42+
],
43+
'@typescript-eslint/await-thenable': 'error',
44+
'@typescript-eslint/ban-ts-comment': 'error',
45+
'@typescript-eslint/ban-types': [
46+
'error',
47+
{
48+
types: {
49+
Object: {
50+
message: 'Avoid using the `Object` type. Did you mean `object`?'
51+
},
52+
Function: {
53+
message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.'
54+
},
55+
Boolean: {
56+
message: 'Avoid using the `Boolean` type. Did you mean `boolean`?'
57+
},
58+
Number: {
59+
message: 'Avoid using the `Number` type. Did you mean `number`?'
60+
},
61+
String: {
62+
message: 'Avoid using the `String` type. Did you mean `string`?'
63+
},
64+
Symbol: {
65+
message: 'Avoid using the `Symbol` type. Did you mean `symbol`?'
66+
}
67+
}
68+
}
69+
],
70+
'@typescript-eslint/consistent-type-assertions': 'error',
71+
'@typescript-eslint/consistent-type-definitions': 'error',
72+
'@typescript-eslint/dot-notation': 'error',
73+
'@typescript-eslint/explicit-member-accessibility': [
74+
'error',
75+
{
76+
accessibility: 'explicit',
77+
overrides: {
78+
accessors: 'explicit',
79+
constructors: 'explicit',
80+
parameterProperties: 'explicit'
81+
}
82+
}
83+
],
84+
'@typescript-eslint/indent': 'off',
85+
'@typescript-eslint/member-delimiter-style': [
86+
'off',
87+
{
88+
multiline: {
89+
delimiter: 'none',
90+
requireLast: true
91+
},
92+
singleline: {
93+
delimiter: 'semi',
94+
requireLast: false
95+
}
96+
}
97+
],
98+
'@typescript-eslint/member-ordering': 'off',
99+
'@typescript-eslint/naming-convention': 'off',
100+
'@typescript-eslint/no-dynamic-delete': 'error',
101+
'@typescript-eslint/no-empty-function': 'error',
102+
'@typescript-eslint/no-empty-interface': 'error',
103+
'@typescript-eslint/no-explicit-any': 'error',
104+
'@typescript-eslint/no-extraneous-class': 'error',
105+
'@typescript-eslint/no-floating-promises': 'error',
106+
'@typescript-eslint/no-for-in-array': 'error',
107+
'@typescript-eslint/no-inferrable-types': [
108+
'error',
109+
{
110+
ignoreProperties: true,
111+
ignoreParameters: true
112+
}
113+
],
114+
'@typescript-eslint/no-misused-new': 'error',
115+
'@typescript-eslint/no-namespace': 'error',
116+
'@typescript-eslint/no-non-null-assertion': 'off',
117+
'@typescript-eslint/no-parameter-properties': 'off',
118+
'@typescript-eslint/no-require-imports': 'error',
119+
'@typescript-eslint/no-shadow': [
120+
'error',
121+
{
122+
hoist: 'all'
123+
}
124+
],
125+
'@typescript-eslint/no-this-alias': 'error',
126+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
127+
'@typescript-eslint/no-unnecessary-qualifier': 'error',
128+
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
129+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
130+
'@typescript-eslint/no-unused-expressions': 'error',
131+
'@typescript-eslint/no-unused-vars': 'off',
132+
'@typescript-eslint/no-use-before-define': 'off',
133+
'@typescript-eslint/no-var-requires': 'error',
134+
'@typescript-eslint/prefer-for-of': 'error',
135+
'@typescript-eslint/prefer-function-type': 'error',
136+
'@typescript-eslint/prefer-namespace-keyword': 'error',
137+
'@typescript-eslint/prefer-readonly': 'error',
138+
'@typescript-eslint/promise-function-async': 'error',
139+
140+
141+
/* start */
142+
143+
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
144+
// '@typescript-eslint/method-signature-style': ['error', 'no-type-imports'],
145+
'@typescript-eslint/consistent-indexed-object-style': "off",
146+
147+
/* end */
148+
149+
150+
'@typescript-eslint/quotes': [
151+
'error',
152+
'single',
153+
{
154+
avoidEscape: true
155+
}
156+
],
157+
'@typescript-eslint/require-await': 'error',
158+
'@typescript-eslint/restrict-plus-operands': 'error',
159+
'@typescript-eslint/semi': ['off', null],
160+
// "@typescript-eslint/strict-boolean-expressions": [
161+
// "error",
162+
// {
163+
// "allowNullable": true,
164+
// "ignoreRhs": true
165+
// }
166+
// ],
167+
'@typescript-eslint/triple-slash-reference': [
168+
'error',
169+
{
170+
path: 'always',
171+
types: 'prefer-import',
172+
lib: 'always'
173+
}
174+
],
175+
'@typescript-eslint/type-annotation-spacing': 'off',
176+
'@typescript-eslint/unbound-method': 'off',
177+
'@typescript-eslint/unified-signatures': 'error',
178+
'arrow-body-style': ['error', 'always'],
179+
'arrow-parens': ['off', 'always'],
180+
'brace-style': ['off', 'off'],
181+
'capitalized-comments': ['error', 'always'],
182+
'class-methods-use-this': 'off',
183+
'comma-dangle': 'error',
184+
complexity: 'error',
185+
'constructor-super': 'error',
186+
curly: 'error',
187+
'default-case': 'error',
188+
'dot-notation': 'error',
189+
'eol-last': 'off',
190+
eqeqeq: ['error', 'always'],
191+
'guard-for-in': 'error',
192+
'id-blacklist': [
193+
'error',
194+
'any',
195+
'Number',
196+
'number',
197+
'String',
198+
'string',
199+
'Boolean',
200+
'boolean',
201+
'Undefined',
202+
'undefined'
203+
],
204+
'id-match': 'error',
205+
'import/no-default-export': 'error',
206+
'import/no-deprecated': 'error',
207+
'import/no-extraneous-dependencies': 'error',
208+
'import/no-internal-modules': [
209+
'error',
210+
{
211+
allow: ['rxjs/operators/*']
212+
}
213+
],
214+
'import/no-unassigned-import': 'error',
215+
'import/order': 'error',
216+
indent: 'off',
217+
'jsdoc/check-alignment': 'error',
218+
'jsdoc/check-indentation': 'error',
219+
'jsdoc/newline-after-description': 'error',
220+
'jsdoc/no-types': 'error',
221+
'linebreak-style': 'off',
222+
'max-classes-per-file': ['error', 1],
223+
'max-len': 'off',
224+
'max-lines': ['error', 500],
225+
'new-parens': 'off',
226+
'newline-per-chained-call': 'off',
227+
'no-bitwise': 'error',
228+
'no-caller': 'error',
229+
'no-cond-assign': 'error',
230+
'no-console': 'error',
231+
'no-debugger': 'error',
232+
'no-duplicate-case': 'error',
233+
'no-duplicate-imports': 'error',
234+
'no-empty': 'error',
235+
'no-empty-function': 'error',
236+
'no-eval': 'error',
237+
'no-extra-bind': 'error',
238+
'no-extra-semi': 'off',
239+
'no-irregular-whitespace': 'off',
240+
'no-magic-numbers': 'off',
241+
'no-multiple-empty-lines': 'off',
242+
'no-new-func': 'error',
243+
'no-new-wrappers': 'error',
244+
'no-null/no-null': 'error',
245+
'no-param-reassign': 'error',
246+
'no-plusplus': [
247+
'off',
248+
{
249+
allowForLoopAfterthoughts: true
250+
}
251+
],
252+
'no-redeclare': 'error',
253+
'no-restricted-syntax': ['error', 'ForInStatement'],
254+
'no-return-await': 'error',
255+
'no-sequences': 'error',
256+
'no-shadow': 'error',
257+
'no-sparse-arrays': 'error',
258+
'no-template-curly-in-string': 'error',
259+
'no-throw-literal': 'error',
260+
'no-trailing-spaces': 'off',
261+
'no-undef-init': 'error',
262+
'no-underscore-dangle': 'error',
263+
'no-unsafe-finally': 'error',
264+
'no-unused-expressions': 'error',
265+
'no-unused-labels': 'error',
266+
'no-unused-vars': 'off',
267+
'no-use-before-define': 'off',
268+
'no-useless-constructor': 'error',
269+
'no-var': 'error',
270+
'no-void': 'error',
271+
'object-shorthand': ['error', 'never'],
272+
'one-var': ['error', 'never'],
273+
'padded-blocks': [
274+
'off',
275+
{
276+
blocks: 'never'
277+
},
278+
{
279+
allowSingleLineBlocks: true
280+
}
281+
],
282+
'padding-line-between-statements': [
283+
'error',
284+
{
285+
blankLine: 'always',
286+
prev: '*',
287+
next: 'return'
288+
}
289+
],
290+
'prefer-arrow/prefer-arrow-functions': 'error',
291+
'prefer-const': 'error',
292+
'prefer-object-spread': 'error',
293+
'prefer-template': 'error',
294+
'quote-props': 'off',
295+
// "quotes": "error",
296+
radix: 'error',
297+
'react/jsx-curly-spacing': 'off',
298+
'react/jsx-equals-spacing': 'off',
299+
'react/jsx-tag-spacing': [
300+
'off',
301+
{
302+
afterOpening: 'allow',
303+
closingSlash: 'allow'
304+
}
305+
],
306+
'react/jsx-wrap-multilines': 'off',
307+
'require-await': 'error',
308+
semi: 'off',
309+
'space-before-function-paren': 'off',
310+
'space-in-parens': ['off', 'never'],
311+
'spaced-comment': [
312+
'error',
313+
'always',
314+
{
315+
markers: ['/']
316+
}
317+
],
318+
'unicorn/filename-case': 'error',
319+
'unicorn/prefer-switch': 'error',
320+
'unicorn/prefer-ternary': 'error',
321+
'use-isnan': 'error',
322+
yoda: 'error',
323+
'@typescript-eslint/tslint/config': [
324+
'error',
325+
{
326+
rules: {
327+
'comment-type': [true, 'singleline', 'multiline', 'doc', 'directive'],
328+
'completed-docs': [
329+
true,
330+
{
331+
enums: true,
332+
classes: {
333+
visibilities: ['exported']
334+
},
335+
functions: {
336+
visibilities: ['exported']
337+
},
338+
methods: {
339+
privacies: ['public', 'protected'],
340+
tags: {
341+
existence: ['inheritdoc']
342+
}
343+
},
344+
properties: {
345+
privacies: ['public', 'protected'],
346+
tags: {
347+
existence: ['inheritdoc']
348+
}
349+
},
350+
interfaces: {
351+
visibilities: ['exported']
352+
},
353+
'enum-members': {
354+
visibilities: ['exported']
355+
}
356+
}
357+
],
358+
encoding: true,
359+
'invalid-void': true,
360+
'match-default-export-name': true,
361+
'no-default-import': true,
362+
'no-inferred-empty-object-type': true,
363+
'no-mergeable-namespace': true,
364+
'no-promise-as-boolean': true,
365+
'no-restricted-globals': true,
366+
'no-tautology-expression': true,
367+
'no-unnecessary-callback-wrapper': true,
368+
'no-unsafe-any': true,
369+
'prefer-method-signature': true,
370+
'prefer-while': true,
371+
'return-undefined': true,
372+
'static-this': true,
373+
'strict-string-expressions': true,
374+
'strict-type-predicates': true,
375+
'switch-final-break': true,
376+
typedef: [true, 'parameter', 'call-signature', 'property-declaration', 'member-variable-declaration'],
377+
'unnecessary-else': true
378+
}
379+
}
380+
]
381+
}
382+
};

0 commit comments

Comments
 (0)