-
Notifications
You must be signed in to change notification settings - Fork 0
/
typescript.js
70 lines (70 loc) · 2.85 KB
/
typescript.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
/* eslint-disable no-magic-numbers */
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['./base', 'plugin:@typescript-eslint/recommended', 'plugin:import/typescript'],
rules: {
'@typescript-eslint/array-type': 'error',
// must disable the base rule as it can report incorrect errors
'brace-style': 'off',
'@typescript-eslint/brace-style': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
overrides: { constructors: 'no-public' }
}
],
// must disable the base rule as it can report incorrect errors
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'error',
// must disable the base rule as it can report incorrect errors
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/no-extra-non-null-assertion': 'error',
// must disable the base rule as it can report incorrect errors
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': ['error'],
// must disable the base rule as it can report incorrect errors
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': ['error'],
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-throw-literal': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
// must disable the base rule as it can report incorrect errors
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': ['error'],
// must disable the base rule as it can report incorrect errors
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' }
],
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-regexp-exec': 'error',
'@typescript-eslint/promise-function-async': 'error',
// must disable the base rule as it can report incorrect errors
quotes: 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/return-await': 'warn',
'require-await': 'off',
'@typescript-eslint/require-await': 'off',
// must disable the base rule as it can report incorrect errors
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}
],
'@typescript-eslint/unified-signatures': 'error'
}
}