-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
86 lines (86 loc) · 2.94 KB
/
index.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
'use strict';
module.exports = {
env: {
es2022: true, // this also sets ecmaVersion parser option to 2022
},
extends: 'eslint:recommended',
reportUnusedDisableDirectives: true,
rules: {
// OVERRIDES FOR 'eslint:recommended'
'no-debugger': 'warn',
'no-mixed-spaces-and-tabs': 'off',
'no-empty': ['error', { allowEmptyCatch: true }], // Allow empty catch statements
'no-constant-condition': ['error', { checkLoops: false }], // Allow while (true)
'no-unused-vars': ['error', { caughtErrors: 'all' }], // Don't allow unused error argument in catch blocks
// WARNINGS
'no-console': 'warn',
'no-alert': 'warn',
// PROBLEMS
// https://eslint.org/docs/latest/rules/#possible-problems
'array-callback-return': ['error', { checkForEach: true }],
'no-constant-binary-expression': 'error',
'no-constructor-return': 'error',
'no-duplicate-imports': 'error',
'no-new-native-nonconstructor': 'error',
'no-promise-executor-return': 'error',
'no-self-compare': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable-loop': 'error',
'no-unused-private-class-members': 'error',
'no-use-before-define': ['error', 'nofunc'],
'require-atomic-updates': 'error',
// https://eslint.org/docs/latest/rules/#suggestions
'accessor-pairs': 'error',
'dot-notation': 'error',
'eqeqeq': ['error', 'smart'],
'no-array-constructor': 'error',
'no-caller': 'error',
'no-else-return': 'error',
'no-empty-static-block': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-implied-eval': 'error',
'no-iterator': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loop-func': 'error',
'no-multi-str': 'error',
'no-new-func': 'error',
'no-new-object': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-return-await': 'error',
'no-script-url': 'error',
'no-sequences': 'error',
'no-undef-init': 'error',
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-constructor': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-destructuring': [
'error',
{
VariableDeclarator: { array: false, object: true },
AssignmentExpression: { array: false, object: false },
},
],
'prefer-exponentiation-operator': 'error',
'prefer-numeric-literals': 'error',
'prefer-object-spread': 'error',
'prefer-regex-literals': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'strict': 'error',
'yoda': ['error', 'never', { onlyEquality: true }],
},
};