forked from kentcdodds/eslint-config-kentcdodds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
possible-errors.js
79 lines (75 loc) · 3.07 KB
/
possible-errors.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
module.exports = {
extends: './non-rules-config.js',
rules: {
'for-direction': 'error',
'getter-return': ['error', {allowImplicit: true}],
'no-async-promise-executor': 'off',
'no-await-in-loop': 'error',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-console': 'error',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty': 'error',
'no-empty-character-class': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'off',
'no-func-assign': 'error',
'no-import-assign': 'error',
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-loss-of-precision': 'error',
'no-misleading-character-class': 'off',
'no-obj-calls': 'error',
'no-promise-executor-return': 'off', // prevents: new Promise(r => setTimeout(r))
'no-prototype-builtins': 'off',
'no-regex-spaces': 'error',
'no-setter-return': 'error',
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-unreachable': 'error',
'no-unreachable-loop': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-useless-backreference': 'error',
'require-atomic-updates': 'off',
'use-isnan': 'error',
'valid-typeof': 'error',
// variables
'no-use-before-define': ['error', 'nofunc'],
},
overrides: [
{
files: ['**/*.ts?(x)'],
rules: {
'getter-return': 'off', // ts(2378)
'no-dupe-args': 'off', // ts(2300)
'no-dupe-keys': 'off', // ts(1117)
'no-func-assign': 'off', // ts(2539)
'no-import-assign': 'off', // ts(2539) & ts(2540)
'no-obj-calls': 'off', // ts(2349)
'no-setter-return': 'off', // ts(2408)
'no-unreachable': 'off', // ts(7027)
'no-unsafe-negation': 'off', // ts(2365) & ts(2360) & ts(2358)
'valid-typeof': 'off', // ts(2367)
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error', 'nofunc'],
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-unsafe-argument': 'warn', // seems like an ok idea, but I don't have enough experience with TS yet.
'@typescript-eslint/no-unsafe-assignment': 'warn', // seems like an ok idea, but I don't have enough experience with TS yet.
'@typescript-eslint/no-unsafe-call': 'warn', // seems like an ok idea, but I don't have enough experience with TS yet.
'@typescript-eslint/no-unsafe-member-access': 'warn', // seems like an ok idea, but I don't have enough experience with TS yet.
'@typescript-eslint/no-unsafe-return': 'off', // seems like an ok idea, but it failed on a regular React Component
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
},
},
],
}