-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
168 lines (163 loc) · 4.25 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/* eslint-env node */
module.exports = {
root: true,
env: {
browser: true,
es2022: true,
},
extends: [
'eslint:recommended',
'plugin:editorconfig/all',
'plugin:jsdoc/recommended',
'plugin:mocha/recommended',
'plugin:optimize-regex/recommended',
'plugin:promise/recommended',
'plugin:security/recommended',
],
parserOptions: {
sourceType: 'module',
},
plugins: [
'editorconfig',
'jsdoc',
'mocha',
'security',
'sort-class-members',
'unused-imports',
],
rules: {
// eslint
'array-callback-return': ['error'],
'array-bracket-spacing': ['error', 'never'],
'array-element-newline': ['error', 'consistent', {
minItems: 2,
}],
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': ['error'],
'brace-style': ['error'],
'camelcase': ['error'],
'comma-dangle': ['error', 'always-multiline'],
'comma-style': ['error'],
'curly': ['error', 'all'],
'default-case': ['error'],
'default-case-last': ['error'],
'default-param-last': ['error'],
'eqeqeq': ['error'],
'func-call-spacing': ['error'],
'function-call-argument-newline': ['error', 'consistent'],
'function-paren-newline': ['error', 'consistent'],
'key-spacing': ['error'],
'keyword-spacing': ['error'],
'linebreak-style': ['error'],
// 'multiline-comment-style': ['error', 'starred-block'],
'new-parens': ['error', 'never'],
'no-alert': ['error'],
'no-confusing-arrow': ['error'],
'no-constructor-return': ['error'],
'no-duplicate-imports': ['error'],
'no-eval': ['error'],
'no-lonely-if': ['error'],
'no-nested-ternary': ['error'],
'no-multi-spaces': ['error'],
'no-multiple-empty-lines': ['error', {
max: 5,
maxBOF: 0,
maxEOF: 1,
}],
'no-plusplus': ['error'],
'no-proto': ['error'],
'no-promise-executor-return': ['error'],
'no-return-await': ['error'],
'no-script-url': ['error'],
'no-self-compare': ['error'],
'no-sequences': ['error'],
'no-shadow': ['error'],
'no-trailing-spaces': ['error'],
'no-undefined': ['error'],
'no-unmodified-loop-condition': ['error'],
'no-unneeded-ternary': ['error'],
'no-unreachable-loop': ['error'],
'no-unused-expressions': ['error'],
'no-unused-labels': ['error'],
'no-unused-private-class-members': ['error'],
'no-use-before-define': ['error'],
'no-useless-call': ['error'],
'no-useless-computed-key': ['error'],
'no-useless-concat': ['error'],
'no-useless-constructor': ['error'],
'no-useless-rename': ['error'],
'no-useless-return': ['error'],
'no-var': ['error'],
'no-void': ['error'],
'no-whitespace-before-property': ['error'],
'object-curly-newline': ['error', {
consistent: true,
minProperties: 2,
}],
'object-curly-spacing': ['error', 'always'],
'prefer-const': ['error'],
'prefer-exponentiation-operator': ['error'],
'prefer-object-has-own': ['error'],
'prefer-object-spread': ['error'],
'prefer-regex-literals': ['error'],
'prefer-spread': ['error'],
'prefer-rest-params': ['error'],
'prefer-template': ['error'],
'quotes': ['error', 'single'],
'radix': ['error'],
'require-atomic-updates': ['error'],
'require-await': ['error'],
'require-unicode-regexp': ['error'],
'semi': ['error', 'never', {
beforeStatementContinuationChars: 'always',
}],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'sort-imports': ['error', {
allowSeparatedGroups: true,
ignoreCase: true,
memberSyntaxSortOrder: [
'none',
'multiple',
'single',
'all',
],
}],
'no-new-func': ['off'],
// editorconfig
'editorconfig/indent': ['error', {
'SwitchCase': 1,
}],
// jsdoc
'jsdoc/require-jsdoc': ['error', {
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
}],
// security
'security/detect-object-injection': ['off'],
// sort-class-members
'sort-class-members/sort-class-members': ['error', {
accessorPairPositioning: 'getThenSet',
order: [
'[static-properties]',
'[static-methods]',
'[conventional-private-properties]',
'[properties]',
'constructor',
'[conventional-private-methods]',
'[methods]',
],
}],
},
settings: {
react: {
version: 'detect',
},
},
}