-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.js
116 lines (114 loc) · 4.34 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
},
plugins: ['react', '@typescript-eslint', 'unused-imports'],
rules: {
'react/jsx-filename-extension': [1, { extensions: ['.tsx'] }],
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': [1, { ignoreFunctionalComponents: true }],
'react/no-array-index-key': 'off',
'unused-imports/no-unused-imports': 'error',
'array-callback-return': ['error'],
'getter-return': ['error'],
'no-async-promise-executor': ['error'],
'no-class-assign': ['error'],
'no-cond-assign': ['error'],
'no-constant-binary-expression': ['error'],
'no-constant-condition': ['error'],
'no-constructor-return': ['error'],
'no-debugger': ['error'],
'no-dupe-args': ['error'],
'no-dupe-class-members': ['error'],
'no-dupe-else-if': ['error'],
'no-dupe-keys': ['error'],
'no-duplicate-case': ['error'],
'no-duplicate-imports': ['error'],
'no-empty-pattern': ['error'],
'no-ex-assign': ['error'],
'no-fallthrough': ['error'],
'no-func-assign': ['error'],
'no-import-assign': ['error'],
'no-inner-declarations': ['error'],
'no-invalid-regexp': ['error'],
'no-irregular-whitespace': ['error'],
'no-obj-calls': ['error'],
'no-promise-executor-return': ['error'],
'no-self-assign': ['error'],
'no-self-compare': ['error'],
'no-setter-return': ['error'],
'no-template-curly-in-string': ['error'],
'no-unexpected-multiline': ['error'],
'no-unmodified-loop-condition': ['error'],
'no-unreachable': ['error'],
'no-unreachable-loop': ['error'],
'no-unsafe-finally': ['error'],
'no-unsafe-negation': ['error'],
'no-unsafe-optional-chaining': ['error'],
'no-unused-private-class-members': ['error'],
'require-atomic-updates': ['error'],
'use-isnan': ['error'],
'valid-typeof': ['error'],
'no-eval': ['error'],
'no-implied-eval': ['error'],
'no-multi-assign': ['error'],
// 'no-useless-return': ['error'], // TODO: consider enabling this
'prefer-const': ['error'],
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow',
},
],
'@typescript-eslint/member-delimiter-style': ['error'],
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true }],
'@typescript-eslint/no-extra-non-null-assertion': ['error'],
'@typescript-eslint/no-extraneous-class': ['error'],
'@typescript-eslint/no-inferrable-types': ['error'],
'@typescript-eslint/no-invalid-void-type': ['error'],
'@typescript-eslint/no-misused-new': ['error'],
'@typescript-eslint/no-unnecessary-type-arguments': ['error'],
'@typescript-eslint/no-unnecessary-type-assertion': ['error'],
'@typescript-eslint/no-unnecessary-type-constraint': ['error'],
'@typescript-eslint/no-var-requires': ['error'],
'@typescript-eslint/prefer-for-of': ['error'],
'@typescript-eslint/prefer-includes': ['error'],
'@typescript-eslint/prefer-nullish-coalescing': ['error'],
'@typescript-eslint/prefer-readonly': ['error'],
'@typescript-eslint/prefer-string-starts-ends-with': ['error'],
'@typescript-eslint/prefer-ts-expect-error': ['error'],
'@typescript-eslint/require-array-sort-compare': ['error', { ignoreStringArrays: true }],
'@typescript-eslint/restrict-plus-operands': ['error'],
'@typescript-eslint/switch-exhaustiveness-check': ['error'],
'@typescript-eslint/no-invalid-this': ['error'],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-expressions': ['error'],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, classes: false, variables: true },
],
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': ['error'],
// 'no-await-in-loop': ['error'], // TODO: enable when possible, refactor code
},
};