This repository has been archived by the owner on Aug 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jscsrc
executable file
·452 lines (330 loc) · 14.3 KB
/
.jscsrc
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
{
// JSCS Default Configuration File (as on JSCS website)
// See http://jscs.info/rules.html for more details
// Requires that a function expression be named.
// "disallowAnonymousFunctions": true,
// Requires the first alphabetical character of a comment to be lowercase.
// "disallowCapitalizedComments": true,
// Disallows commas as last token on a line in lists.
// "disallowCommaBeforeLineBreak": true,
// Disallows curly braces after statements.
// "disallowCurlyBraces": true,
// Disallows identifiers that start or end in _. Some popular identifiers are automatically listed as exceptions:
// "disallowDanglingUnderscores": true,
// Disallows empty blocks (except for catch blocks).
"disallowEmptyBlocks": true,
// Disallows function declarations.
"disallowFunctionDeclarations": true,
// Disallows a specified set of identifier names.
// "disallowIdentifierNames": [
// "matko"
// ],
// Disallows implicit type conversion.
"disallowImplicitTypeConversion": [
"numeric",
"boolean",
"binary",
"string"
],
// Disallows keywords in your comments, such as TODO or FIXME.
// "disallowKeywordsInComments": true,
// Disallows placing keywords on a new line.
"disallowKeywordsOnNewLine": [
"else",
"catch"
],
// Disallows usage of specified keywords.
"disallowKeywords": [
"with"
],
// Requires lines to not contain both spaces and tabs consecutively, or spaces after tabs only for alignment if "smart".
"disallowMixedSpacesAndTabs": true,
// Disallows multiple blank lines in a row.
"disallowMultipleLineBreaks": true,
// Disallows strings that span multiple lines without using concatenation.
"disallowMultipleLineStrings": true,
// Disallows multiple indentation characters (tabs or spaces) between identifiers, keywords, and any other token.
// "disallowMultipleSpaces": true,
// Disallows multiple var declaration (except for-loop).
// "disallowMultipleVarDecl": true,
// Disallows unassigned functions to be named inline.
// "disallowNamedUnassignedFunctions": true,
// Disallows newline before opening curly brace of all block statements.
"disallowNewlineBeforeBlockStatements": true,
// Disallows the not, not equals, and strict not equals operators in conditionals.
// "disallowNotOperatorsInConditionals": true,
// Requires putting certain operators on the next line rather than on the current line before a line break.
"disallowOperatorBeforeLineBreak": [
"+",
"."
],
// Disallow a newline after blocks.
// "disallowPaddingNewLinesAfterBlocks": true,
// Disallow a blank line after 'use strict'; statements.
// "disallowPaddingNewLinesAfterUseStrict": true,
// Disallows newline before module.exports.
// "disallowPaddingNewLinesBeforeExport": true,
// Disallow an empty line above the specified keywords.
// "disallowPaddingNewlinesBeforeKeywords": true,
// Disallows newline before line comments.
// "disallowPaddingNewLinesBeforeLineComments": true,
// Disallows blocks from beginning or ending with 2 newlines.
// "disallowPaddingNewlinesInBlocks": true,
// Disallows newline inside curly braces of all objects.
// "disallowPaddingNewLinesInObjects": true,
// Disallows quoted keys in object if possible.
"disallowQuotedKeysInObjects": true,
// Disallows lines from ending in a semicolon.
// "disallowSemicolons": true,
// Requires sticking binary operators to the right.
// "disallowSpaceAfterBinaryOperators": true,
// Disallows space after keyword.
// "disallowSpaceAfterKeywords": true,
// Requires that a line comment (//) not be followed by a space.
// "disallowSpaceAfterLineComment": true,
// Disallows space after object keys.
"disallowSpaceAfterObjectKeys": true,
// Requires sticking unary operators to the right.
"disallowSpaceAfterPrefixUnaryOperators": true,
// Requires sticking binary operators to the left.
// "disallowSpaceBeforeBinaryOperators": true,
// Disallows space before block statements (for loops, control structures).
// "disallowSpaceBeforeBlockStatements": true,
// Disallows space before keyword.
// "disallowSpaceBeforeKeywords": true,
// Disallows space after object keys.
// "disallowSpaceBeforeObjectValues": true,
// Requires sticking unary operators to the left.
"disallowSpaceBeforePostfixUnaryOperators": true,
// Ensure there are no spaces after argument separators in call expressions.
// "disallowSpaceBetweenArguments": true,
// Disallows space before () or {} in anonymous function expressions.
// "disallowSpacesInAnonymousFunctionExpression": {
// "beforeOpeningRoundBrace": true,
// "beforeOpeningCurlyBrace": true
// },
// Disallows space before () in call expressions.
// "disallowSpacesInCallExpression": true,
// Disallows space before and/or after ? or : in conditional expressions.
// "disallowSpacesInConditionalExpression": true,
// Disallow spaces in between for statement.
// "disallowSpacesInForStatement": true,
// Disallows space before () or {} in function declarations.
// "disallowSpacesInFunctionDeclaration": {
// "beforeOpeningRoundBrace": true,
// "beforeOpeningCurlyBrace": true
// },
// Disallows space before () or {} in function expressions (both named and anonymous).
// "disallowSpacesInFunctionExpression": {
// "beforeOpeningRoundBrace": true,
// "beforeOpeningCurlyBrace": true
// },
// Expression.
// "disallowSpacesInFunction": {
// "beforeOpeningRoundBrace": true,
// "beforeOpeningCurlyBrace": true
// },
// Disallows space before () or {} in named function expressions.
// "disallowSpacesInNamedFunctionExpression": {
// "beforeOpeningRoundBrace": true,
// "beforeOpeningCurlyBrace": true
// },
// Disallows space after opening array square bracket and before closing.
"disallowSpacesInsideArrayBrackets": true,
// Disallows space after opening square bracket and before closing.
// "disallowSpacesInsideBrackets": true,
// Disallows space after opening object curly brace and before closing.
"disallowSpacesInsideObjectBrackets": true,
// Disallows space after opening round bracket and before closing.
"disallowSpacesInsideParentheses": true,
// Disallows an extra comma following the final element of an array or object literal.
"disallowTrailingComma": true,
// Requires all lines to end on a non-whitespace character.
"disallowTrailingWhitespace": true,
// Requires the variable to be the left hand operator when doing a boolean comparison.
"disallowYodaConditions": true,
// Requires all lines to be at most the number of characters specified.
"maximumLineLength": {
"value": 160,
"tabSize": 4,
"allowComments": false,
"allowUrlComments": false,
"allowRegex": false
},
// Requires the file to be at most the number of lines specified.
"maximumNumberOfLines": 200,
// Requires proper alignment in object literals.
// "requireAlignedObjectValues": "all",
// Requires that a function expression be anonymous.
// "requireAnonymousFunctions": true,
// Requires blocks to begin and end with a newline.
// "requireBlocksOnNewline": true,
// Requires identifiers to be camelCased or UPPERCASE_WITH_UNDERSCORES.
"requireCamelCaseOrUpperCaseIdentifiers": true,
// Requires the first alphabetical character of a comment to be uppercase, unless it is part of a multi-line textblock.
// "requireCapitalizedComments": true,
// Requires constructors to be capitalized (except for this).
"requireCapitalizedConstructors": true,
// Requires commas as last token on a line in lists.
"requireCommaBeforeLineBreak": true,
// Requires curly braces after statements.
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
// Require a $ before variable names that are jquery assignments.
// "requireDollarBeforejQueryAssignment": true,
// Requires member expressions to use dot notation when possible.
"requireDotNotation": true,
// Requires function declarations by disallowing assignment of functions expressions to variables.
// Function expressions are allowed in all other contexts, including when passed as function arguments or immediately invoked.
// "requireFunctionDeclarations": true,
// Requires placing keywords on a new line.
// "requireKeywordsOnNewLine": [
// "else"
// ],
// Requires placing line feed after assigning a variable.
// "requireLineBreakAfterVariableAssignment": true,
// Requires placing line feed at file end.
"requireLineFeedAtFileEnd": true,
// Requires multiple var declaration.
// "requireMultipleVarDecl": true,
// Require unassigned functions to be named inline.
// "requireNamedUnassignedFunctions": true,
// Requires newline before opening curly brace of all block statements.
// "requireNewlineBeforeBlockStatements": true,
// Requires operators to appear before line breaks and not after.
"requireOperatorBeforeLineBreak": true,
// Requires an extra blank newline after var declarations, as long as it is not the last expression in the current block.
// "requirePaddingNewLineAfterVariableDeclaration": true,
// Requires newline after blocks.
// "requirePaddingNewLinesAfterBlocks": true,
// Requires a blank line after 'use strict'; statements.
// "requirePaddingNewLinesAfterUseStrict": true,
// Requires newline before module.exports.
// "requirePaddingNewLinesBeforeExport": true,
// Requires an empty line above the specified keywords unless the keyword is the first expression in a block.
// "requirePaddingNewlinesBeforeKeywords": true,
// Requires newline before line comments.
// "requirePaddingNewLinesBeforeLineComments": true,
// Requires blocks to begin and end with 2 newlines.
// "requirePaddingNewlinesInBlocks": true,
// Requires newline inside curly braces of all objects.
// "requirePaddingNewLinesInObjects": true,
// Requires parentheses around immediately invoked function expressions.
"requireParenthesesAroundIIFE": true,
// Requires quoted keys in objects.
// "requireQuotedKeysInObjects": true,
// Requires semicolon after:
"requireSemicolons": true,
// Disallows sticking binary operators to the right.
"requireSpaceAfterBinaryOperators": true,
// Requires space after keyword.
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"case",
"return",
"try",
"catch",
"function",
"typeof"
],
// Requires that a line comment (//) be followed by a space.
"requireSpaceAfterLineComment": true,
// Requires space after object keys.
// "requireSpaceAfterObjectKeys": true,
// Disallows sticking unary operators to the right.
// "requireSpaceAfterPrefixUnaryOperators": true,
// Disallows sticking binary operators to the left.
"requireSpaceBeforeBinaryOperators": true,
// Requires space(s) before block statements (for loops, control structures).
"requireSpaceBeforeBlockStatements": true,
// Requires space before keyword.
// "requireSpaceBeforeKeywords": true,
// Requires space after object keys.
// "requireSpaceBeforeObjectValues": true,
// Disallows sticking unary operators to the left.
// "requireSpaceBeforePostfixUnaryOperators": true,
// Ensure there are spaces after argument separators in call expressions.
// "requireSpaceBetweenArguments": true,
// Requires space before () or {} in anonymous function expressions.
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
// Requires space before () in call expressions.
// "requireSpacesInCallExpression": true,
// Requires space before and/or after ? or : in conditional expressions.
"requireSpacesInConditionalExpression": true,
// Requires spaces inbetween for statement.
// "requireSpacesInForStatement": true,
// Requires space before () or {} in function declarations.
"requireSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
// Requires space before () or {} in function expressions (both named and anonymous).
"requireSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
// Expression.
"requireSpacesInFunction": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
// Requires space before () or {} in named function expressions.
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
// Requires space after opening array square bracket and before closing.
// "requireSpacesInsideArrayBrackets": "all",
// Requires space after opening square bracket and before closing.
// "requireSpacesInsideBrackets": true,
// Requires space after opening object curly brace and before closing.
// "requireSpacesInsideObjectBrackets": "all",
// Requires space after opening round bracket and before closing.
// "requireSpacesInsideParentheses": "all",
// Requires an extra comma following the final element of an array or object literal.
// "requireTrailingComma": true,
// Requires the variable to be the right hand operator when doing a boolean comparison.
// "requireYodaConditions": true,
// Option to check var that = this expressions.
"safeContextKeyword": [
"_this"
],
// Validates proper alignment of function parameters.
// "validateAlignedFunctionParameters": {
// "lineBreakAfterOpeningBraces": true,
// "lineBreakBeforeClosingBraces": true
// },
// Validates indentation for switch statements and block statements.
// "validateIndentation": 2,
// Option to check line break characters.
"validateLineBreaks": "LF",
// Requires each element in array on a single line when array length is more than passed maximum number or array fills more than one line.
// Set ignoreBrackets to true to allow elements on the same line with brackets.
"validateNewlineAfterArrayElements": {
"maximum": 3
},
// Enable validation of separators between function parameters. Will ignore newlines.
"validateParameterSeparator": ", ",
// Requires all quote marks to be either the supplied value, or consistent if true.
"validateQuoteMarks": "'",
// Validate JSDoc.
"validateJSDoc": {
"checkParamNames": true,
"requireParamTypes": true
}
}