-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jscsrc
106 lines (102 loc) · 3.8 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
{
"fileExtensions": [".js"],
"excludeFiles": [
"test/**",
"benchmarks/**",
"docs/**",
"node_modules/**",
"coverage/**"
],
//RESTRICTIONS:
//"disallowAnonymousFunctions": false, //anonymous functions are allowed but discouraged
"disallowImplicitTypeConversion": ["numeric", "boolean", "binary", "string"],
"disallowKeywordsOnNewLine": ["else"], //the `else` keyword cannot be placed on a newline
"disallowMultipleLineStrings": true, //multiline strings are not allowed; use concatenation instead
"disallowMultipleSpaces": true,
"disallowMultipleVarDecl": true, //variables must be declared on separated lines; do not use comma like in var a,b;
"disallowNewlineBeforeBlockStatements": true, //the opening curly brace of a block cannot be on a newline
"disallowOperatorBeforeLineBreak": ["."], //the dot operator should not be placed at the end of a line
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforeComma": true,
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpaceBeforeSemicolon": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
//ENFORCEMENTS
"maximumLineLength": {
"value": 100,
"tabSize": 2,
"allExcept": ["regex", "comments", "urlComments", "require"]
},
//"maximumNumberOfLines": 250, //don't limit number of lines as jscs counts comment lines as well
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": true,
"requireFunctionDeclarations": true,
"requireLineBreakAfterVariableAssignment": true,
"requireLineFeedAtFileEnd": true,
"requireObjectKeysOnNewLine": true,
"requireOperatorBeforeLineBreak": true,
"requirePaddingNewLineAfterVariableDeclaration": true,
"requirePaddingNewLinesAfterUseStrict": true,
"requirePaddingNewLinesBeforeLineComments": { "allExcept": "firstAfterCurly" },
"requirePaddingNewLinesInObjects": true,
"requireParenthesesAroundIIFE": true,
"requireSemicolons": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInConditionalExpression": true,
"requireSpacesInForStatement": true,
"safeContextKeyword": ["_this"],
"validateAlignedFunctionParameters": true,
"validateIndentation": {
"value": 2,
"allExcept": ["comments", "emptyLines"]
},
"validateLineBreaks": "LF",
"validateNewlineAfterArrayElements": {
"ignoreBrackets": true
},
"validateParameterSeparator": ", ",
"validateQuoteMarks": {
"mark": "\"",
"escape": true
},
"jsDoc": {
"checkAnnotations": {
"preset": "jsdoc3",
"extra": {
"interface": true,
"final": true,
"checkParamNames": true,
"requireParamTypes": true,
"checkRedundantParams": true,
"checkReturnTypes": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"checkTypes": "strictNativeCase",
"checkRedundantAccess": "enforceLeadingUnderscore",
"enforceExistence": true,
"leadingUnderscoreAccess": true,
"requireHyphenBeforeDescription": true,
"requireNewlineAfterDescription": true,
"requireDescriptionCompleteSentence": true,
"requireParamDescription": true
}
}
}
}