-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
211 lines (211 loc) · 7.97 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
module.exports = {
env: {
browser: true,
node: true,
es6: true
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:security/recommended",
"plugin:sonarjs/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:functional/external-recommended",
"plugin:functional/recommended"
],
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"security",
"functional",
"no-secrets",
"no-param-reassign-allow-reduce"
],
parserOptions: {
project: "./tsconfig.json",
ecmaVersion: 11,
sourceType: "module"
},
rules: {
"sonarjs/no-redundant-jump": "off",
"no-secrets/no-secrets": "error",
"security/detect-buffer-noassert": "error",
"security/detect-child-process": "error",
"security/detect-disable-mustache-escape": "error",
"security/detect-eval-with-expression": "error",
"security/detect-new-buffer": "error",
"security/detect-no-csrf-before-method-override": "error",
"security/detect-non-literal-fs-filename": "error",
"security/detect-non-literal-regexp": "error",
"security/detect-non-literal-require": "error",
"security/detect-object-injection": "error",
"security/detect-possible-timing-attacks": "error",
"security/detect-pseudoRandomBytes": "error",
"security/detect-unsafe-regex": "error",
"functional/no-mixed-type": "off",
"functional/no-let": "off",
"functional/no-return-void": "off",
"functional/no-expression-statement": "off",
"functional/no-conditional-statement": "off",
"functional/no-try-statement": "off",
"functional/prefer-readonly-type": "off",
"functional/functional-parameters": "off",
"security/detect-object-injection": "off",
"functional/prefer-type-literal": "off",
"no-console": "error",
"no-template-curly-in-string": "error",
curly: "error",
"default-case": "error",
"default-case-last": "error",
"default-param-last": "off",
"@typescript-eslint/default-param-last": ["error"],
"dot-notation": "error",
eqeqeq: "error",
"no-alert": "error",
"no-else-return": "error",
"no-empty-function": "off",
"@typescript-eslint/no-empty-function": ["error"],
"no-eval": "error",
"no-floating-decimal": "error",
"no-loop-func": "error",
"no-magic-numbers": "off",
"@typescript-eslint/no-require-imports": "error",
"no-multi-str": "error",
"no-new-wrappers": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-param-reassign-allow-reduce/allow-reduce": "error",
"no-param-reassign-allow-reduce/no-reduce-identifiers": "error",
"no-return-assign": "error",
"no-self-assign": "error",
"no-self-compare": "error",
"no-throw-literal": "off",
"@typescript-eslint/no-throw-literal": "error",
"no-useless-concat": "error",
"no-useless-return": "error",
"prefer-regex-literals": "error",
"require-await": "off",
"@typescript-eslint/require-await": "error",
yoda: "error",
"init-declarations": "off",
"@typescript-eslint/init-declarations": ["error"],
"no-shadow": ["error", { builtinGlobals: false, hoist: "all" }],
"no-undef-init": "error",
camelcase: "off",
"import/no-duplicates": "off",
"import/named": "error",
"import/export": "error",
"import/order": [
"error",
{ "newlines-between": "always-and-inside-groups" }
],
"import/newline-after-import": "error",
"import/no-absolute-path": "error",
"import/no-cycle": "error",
"import/no-mutable-exports": "error",
"import/no-self-import": "error",
"import/first": "error",
"comma-dangle": "error",
"id-length": "error",
"line-comment-position": "error",
"max-depth": "error",
"max-nested-callbacks": ["error", { max: 3 }],
"max-params": ["error", { max: 5 }],
"multiline-comment-style": ["error", "starred-block"],
"no-array-constructor": "off",
"@typescript-eslint/no-array-constructor": ["error"],
"no-bitwise": "error",
"no-continue": "error",
"no-inline-comments": "error",
"no-lonely-if": "error",
"no-multi-assign": "error",
"no-nested-ternary": "error",
"no-new-object": "error",
"no-unneeded-ternary": "error",
"prefer-exponentiation-operator": "error",
"prefer-object-spread": "error",
"no-confusing-arrow": "error",
"no-duplicate-imports": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-destructuring": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"no-invalid-this": "off",
"@typescript-eslint/no-invalid-this": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/array-type": [
"error",
{ default: "array", readonly: "array" }
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true }
],
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/method-signature-style": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/naming-convention": [
"error",
{
selector: "default",
format: ["camelCase"]
},
{
selector: "variable",
types: ["boolean"],
format: ["PascalCase"],
prefix: ["is", "should", "has", "can", "did", "will"]
},
{
selector: "variable",
format: ["camelCase", "UPPER_CASE", "PascalCase"]
},
{
selector: "property",
format: ["camelCase", "UPPER_CASE", "PascalCase"]
},
{
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow"
},
{
selector: "typeLike",
format: ["PascalCase"]
},
{
selector: "interface",
format: ["PascalCase"],
custom: {
regex: "^I[A-Z]",
match: false
}
}
]
},
ignorePatterns: ["node_modules", "build"]
};