1
1
"use strict" ;
2
2
3
3
module . exports = {
4
- " env" : {
5
- " node" : true ,
6
- " es6" : true
4
+ env : {
5
+ node : true ,
6
+ es6 : true
7
7
} ,
8
8
9
- "parserOptions" : {
10
- "ecmaVersion" : 9
9
+ plugins : [ "prettier" ] ,
10
+ extends : [ "prettier" ] ,
11
+
12
+ parserOptions : {
13
+ ecmaVersion : 9
11
14
} ,
12
15
13
- " globals" : {
14
- " fetch" : false ,
15
- " WebAssembly" : false
16
+ globals : {
17
+ fetch : false ,
18
+ WebAssembly : false
16
19
} ,
17
20
18
- " rules" : {
21
+ rules : {
19
22
// Require spacing around =>
20
23
"arrow-spacing" : "error" ,
21
24
@@ -26,17 +29,17 @@ module.exports = {
26
29
"block-spacing" : "error" ,
27
30
28
31
// No newline before open brace for a block
29
- "brace-style" : [ "error" , "1tbs" , { " allowSingleLine" : true } ] ,
32
+ "brace-style" : [ "error" , "1tbs" , { allowSingleLine : true } ] ,
30
33
31
34
// No space before always a space after a comma
32
- "comma-spacing" : [ "error" , { " after" : true , " before" : false } ] ,
35
+ "comma-spacing" : [ "error" , { after : true , before : false } ] ,
33
36
34
37
// Commas at the end of the line not the start
35
38
"comma-style" : "error" ,
36
39
37
40
// Warn about cyclomatic complexity in functions.
38
41
// XXX Get this down to 20?
39
- " complexity" : [ "error" , 25 ] ,
42
+ complexity : [ "error" , 25 ] ,
40
43
41
44
// Don't require spaces around computed properties
42
45
"computed-property-spacing" : [ "error" , "never" ] ,
@@ -45,7 +48,7 @@ module.exports = {
45
48
"consistent-return" : "error" ,
46
49
47
50
// Require braces around blocks that start a new line
48
- " curly" : [ "error" , "multi-line" ] ,
51
+ curly : [ "error" , "multi-line" ] ,
49
52
50
53
// Encourage the use of dot notation whenever possible.
51
54
"dot-notation" : "error" ,
@@ -57,17 +60,20 @@ module.exports = {
57
60
"func-call-spacing" : "error" ,
58
61
59
62
// Require function* name()
60
- "generator-star-spacing" : [ "error" , { " after" : true , " before" : false } ] ,
63
+ "generator-star-spacing" : [ "error" , { after : true , before : false } ] ,
61
64
62
65
// Two space indent
63
66
// "indent": ["error", 2, { "SwitchCase": 1 }],
64
67
65
68
// Space after colon not before in property declarations
66
- "key-spacing" : [ "error" , {
67
- "afterColon" : true ,
68
- "beforeColon" : false ,
69
- "mode" : "minimum"
70
- } ] ,
69
+ "key-spacing" : [
70
+ "error" ,
71
+ {
72
+ afterColon : true ,
73
+ beforeColon : false ,
74
+ mode : "minimum"
75
+ }
76
+ ] ,
71
77
72
78
// Require spaces before and after keywords
73
79
"keyword-spacing" : "error" ,
@@ -125,7 +131,7 @@ module.exports = {
125
131
"no-else-return" : "error" ,
126
132
127
133
// No empty statements
128
- "no-empty" : [ "error" , { " allowEmptyCatch" : true } ] ,
134
+ "no-empty" : [ "error" , { allowEmptyCatch : true } ] ,
129
135
130
136
// No empty character classes in regex
131
137
"no-empty-character-class" : "error" ,
@@ -163,7 +169,7 @@ module.exports = {
163
169
// Disallow the use of the __iterator__ property
164
170
"no-iterator" : "error" ,
165
171
166
- // No labels
172
+ // No labels
167
173
"no-labels" : "error" ,
168
174
169
175
// Disallow unnecessary nested blocks
@@ -176,12 +182,17 @@ module.exports = {
176
182
// "no-mixed-spaces-and-tabs": "error",
177
183
178
184
// No unnecessary spacing
179
- "no-multi-spaces" : [ "error" , { exceptions : {
180
- "ArrayExpression" : true ,
181
- "AssignmentExpression" : true ,
182
- "ObjectExpression" : true ,
183
- "VariableDeclarator" : true
184
- } } ] ,
185
+ "no-multi-spaces" : [
186
+ "error" ,
187
+ {
188
+ exceptions : {
189
+ ArrayExpression : true ,
190
+ AssignmentExpression : true ,
191
+ ObjectExpression : true ,
192
+ VariableDeclarator : true
193
+ }
194
+ }
195
+ ] ,
185
196
186
197
// No reassigning native JS objects
187
198
"no-native-reassign" : "error" ,
@@ -250,10 +261,13 @@ module.exports = {
250
261
"no-unsafe-negation" : "error" ,
251
262
252
263
// No declaring variables that are never used
253
- "no-unused-vars" : [ "error" , {
254
- "args" : "none" ,
255
- "vars" : "local"
256
- } ] ,
264
+ "no-unused-vars" : [
265
+ "error" ,
266
+ {
267
+ args : "none" ,
268
+ vars : "local"
269
+ }
270
+ ] ,
257
271
258
272
// No using variables before defined
259
273
"no-use-before-define" : [ "error" , "nofunc" ] ,
@@ -278,48 +292,58 @@ module.exports = {
278
292
"no-with" : "error" ,
279
293
280
294
// Require object-literal shorthand with ES6 method syntax
281
- "object-shorthand" : [ "error" , "always" , { " avoidQuotes" : true } ] ,
295
+ "object-shorthand" : [ "error" , "always" , { avoidQuotes : true } ] ,
282
296
283
297
// Use const instead of let where possible
284
298
"prefer-const" : "error" ,
285
299
286
300
// Require double-quotes everywhere, except where quotes are escaped
287
301
// or template literals are used.
288
- "quotes" : [ "error" , "double" , {
289
- "allowTemplateLiterals" : true ,
290
- "avoidEscape" : true
291
- } ] ,
302
+ quotes : [
303
+ "error" ,
304
+ "double" ,
305
+ {
306
+ allowTemplateLiterals : true ,
307
+ avoidEscape : true
308
+ }
309
+ ] ,
292
310
293
311
// No spacing inside rest or spread expressions
294
312
"rest-spread-spacing" : "error" ,
295
313
296
314
// Always require semicolon at end of statement
297
- " semi" : [ "error" , "always" ] ,
315
+ semi : [ "error" , "always" ] ,
298
316
299
317
// Require space before blocks
300
318
"space-before-blocks" : "error" ,
301
319
302
320
// Never use spaces before function parentheses
303
- "space-before-function-paren" : [ "error" , {
304
- "anonymous" : "never" ,
305
- "asyncArrow" : "always" ,
306
- "named" : "never"
307
- } ] ,
321
+ "space-before-function-paren" : [
322
+ "error" ,
323
+ {
324
+ anonymous : "never" ,
325
+ asyncArrow : "always" ,
326
+ named : "never"
327
+ }
328
+ ] ,
308
329
309
330
// No space padding in parentheses
310
331
"space-in-parens" : [ "error" , "never" ] ,
311
332
312
333
// Require spaces around operators
313
- "space-infix-ops" : [ "error" , { " int32Hint" : true } ] ,
334
+ "space-infix-ops" : [ "error" , { int32Hint : true } ] ,
314
335
315
336
// ++ and -- should not need spacing
316
- "space-unary-ops" : [ "error" , {
317
- "nonwords" : false ,
318
- "overrides" : {
319
- "typeof" : false // We tend to use typeof as a function call
320
- } ,
321
- "words" : true
322
- } ] ,
337
+ "space-unary-ops" : [
338
+ "error" ,
339
+ {
340
+ nonwords : false ,
341
+ overrides : {
342
+ typeof : false // We tend to use typeof as a function call
343
+ } ,
344
+ words : true
345
+ }
346
+ ] ,
323
347
324
348
// Requires or disallows a whitespace (space or tab) beginning a comment
325
349
"spaced-comment" : "error" ,
@@ -328,6 +352,9 @@ module.exports = {
328
352
"use-isnan" : "error" ,
329
353
330
354
// Only check typeof against valid results
331
- "valid-typeof" : "error"
355
+ "valid-typeof" : "error" ,
356
+
357
+ "prettier/prettier" : "error" ,
358
+ "max-len" : [ "error" , { code : 120 , ignoreUrls : true } ]
332
359
}
333
360
} ;
0 commit comments