-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
75 lines (75 loc) · 2.49 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
browser: true,
es2022: true,
},
extends: ['eslint:recommended','prettier'],
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
'object-curly-newline': 'off',
semi: 'off',
'func-names': 'off',
'max-len': 'off',
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'consistent-return': 'off',
'no-use-before-define': 'off', // a lot off errors
radix: 'error',
indent: ['error', 4],
'padded-blocks': [
'warn',
{ blocks: 'never', classes: 'always', switches: 'never' },
],
'no-prototype-builtins': 'error',
'no-restricted-syntax': 'off', // need sort it out
'implicit-arrow-linebreak': ['error', 'below'],
camelcase: 'off',
'max-classes-per-file': ['error', { max: 2 }],
'no-shadow': 'off', // a lot of errors
'new-cap': 'off',
'no-lonely-if': 'error',
'no-useless-escape': 'error',
'no-return-await': 'error',
'no-nested-ternary': 'off', // a ? xxx : bbb ? ccc : ddd
'no-unused-expressions': 'error',
'no-bitwise': 'off',
'computed-property-spacing': 'off',
'guard-for-in': 'error',
'no-unused-vars': 'off',
'no-throw-literal': 'off',
'no-trailing-spaces': 'off',
'no-return-assign': 'error',
'no-useless-return': 'off',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-fallthrough': 'error',
'operator-assignment': 'off',
'no-console': 'off',
'no-alert': 'off', // we use window.prompt
'no-constant-condition': 'off',
'no-unreachable': 'off',
'no-multi-assign': 'error',
'no-tabs': 'error',
'array-callback-return': 'off',
'no-debugger': 'warn',
'default-case': 'error',
'import/named': 'off',
'no-undef': 'off',
'no-underscore-dangle': 'off',
'prefer-promise-reject-errors': 'off',
'prefer-destructuring': 'off',
'prefer-rest-params': 'off',
'prefer-const': 'off',
'class-methods-use-this': 'error',
'no-param-reassign': ['off', { props: false }],
},
settings: {
'import/resolver': {
node: {
paths: ['src'],
extensions: [''],
},
},
},
}