-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy path.eslintrc.json
231 lines (231 loc) · 5.86 KB
/
.eslintrc.json
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
{
"parserOptions": {
"ecmaVersion": 2018,
"requireConfigFile": false,
"sourceType": "module",
"babelOptions": {
"presets": ["@babel/preset-react"]
}
},
"parser": "@babel/eslint-parser",
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"plugins": [
"jest",
"no-unsanitized"
],
"env": {
"browser": true,
"es6": true,
"amd": true,
"webextensions": true,
"jest": true,
"node": true
},
"globals": {
"global": true,
"__": true,
"secretComplexity": true,
"port": true,
"Validator": true,
"openpgp": true,
"PapaParse": true,
"kdbxweb": true,
"storage": true,
"jsSHA": true,
"XRegExp": true,
"stripslashes": true,
"urldecode": true,
"OpenpgpkeyEntity": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"strict": [
"error",
"never"
],
/* possible errors */
"no-console": 0,
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
// disallow empty block statements
/* best practices */
"curly": 2,
// enforce consistent brace style for all control statements
"no-eval": 2,
// disallow the use of eval()
"no-extend-native": [
"error",
{
"exceptions": ["Error"]
}
],
// disallow extending native types
"no-global-assign": 2,
// disallow assignments to native objects or read-only global variables
"no-implicit-coercion": 2,
// disallow shorthand type conversions
"no-implicit-globals": 2,
// disallow var and named function declarations in the global scope
"no-implied-eval": 2,
// disallow the use of eval()-like methods
"no-lone-blocks": 2,
// disallow unnecessary nested blocks
"no-useless-escape": 0,
// disallow unnecessary escape characters
/* Stylistic Issues */
"array-bracket-spacing": 1,
// enforce consistent spacing inside array brackets
"block-spacing": 1,
// enforce consistent spacing inside single-line blocks
"brace-style": [
"warn",
"1tbs",
{
"allowSingleLine": true
}
],
// enforce consistent brace style for blocks
"comma-spacing": 1,
// enforce consistent spacing before and after commas
"computed-property-spacing": 1,
// enforce consistent spacing inside computed property brackets
"eol-last": 1,
// enforce at least one newline at the end of files
"func-call-spacing": 1,
// enforce consistent indentation
"key-spacing": [
"warn",
{
"mode": "minimum"
}
],
// enforce consistent spacing before and after keywords
"keyword-spacing": 1,
// enforce consistent spacing between keys and values in object literal properties
"linebreak-style": 1,
// enforce consistent linebreak style
"no-trailing-spaces": 1,
// disallow trailing whitespace at the end of lines
"no-var": 1,
// require let or const instead of var
"object-curly-spacing": [
"warn",
"never"
],
// enforce consistent spacing inside braces
"one-var": [
"warn",
"never"
],
// enforce variables to be declared either together or separately in functions
"padded-blocks": [
"warn",
"never"
],
// require or disallow padding within blocks
"semi": [
"warn",
"always"
],
// require or disallow semicolons instead of ASI
"semi-spacing": 1,
// enforce consistent spacing before and after semicolons
"space-before-blocks": 1,
// enforce consistent spacing before blocks
"space-before-function-paren": [
"warn",
"never"
],
// enforce consistent spacing before function definition opening parenthesis
"space-in-parens": [
"warn",
"never"
],
// enforce consistent spacing inside parentheses
"space-infix-ops": 1,
// require spacing around operators
/* ES6 */
"arrow-body-style": [
"warn",
"as-needed"
],
// require braces around arrow function bodies
"arrow-parens": [
"warn",
"as-needed"
],
// require parentheses around arrow function arguments
"arrow-spacing": 1,
// enforce consistent spacing before and after the arrow in arrow functions
"no-useless-constructor": 1,
// disallow unnecessary constructors
//"object-shorthand": ["warn", "always", {"avoidQuotes": true}], // require or disallow method and property shorthand syntax for object literals
"prefer-arrow-callback": [
"warn",
{
"allowNamedFunctions": true
}
],
// require arrow functions as callbacks
"prefer-const": 1,
// require const declarations for variables that are never reassigned after declared
"prefer-template": 1,
// require template literals instead of string concatenation
"template-curly-spacing": [
"warn",
"never"
],
// require or disallow spacing around embedded expressions of template strings
/* PASSBOLT EXTENDED RULES */
"prefer-const": [
"error"
],
"func-names": [
"error",
"never"
],
"object-shorthand": [
"error",
"consistent"
],
"multiline-comment-style": [
"error",
"starred-block"
],
// enforce multiple comment block line to follow indentation
"one-var": [
"error",
{
"initialized": "never",
"uninitialized": "always"
}
],
/*
* require or disallow spacing between function identifiers and their invocations
* enforce variables to be declared either together or separately in functions
*/
"indent": [
"warn",
2,
{
"MemberExpression": 1,
"SwitchCase": 1
}
],
// enforce consistent indentation
// Mozilla unsanitized rules
"no-unsanitized/method": "error",
"no-unsanitized/property": "error"
}
}