jscs.conf.js
1.6 KB
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
module.exports = {
options: {
requireCurlyBraces: [ 'if', 'else', 'for', 'while', 'do', 'try', 'catch' ],
requireSpacesInFunctionExpression: { beforeOpeningCurlyBrace: true },
disallowSpacesInFunctionExpression: { beforeOpeningRoundBrace: true },
disallowSpacesInsideParentheses: true,
requireSpacesInsideObjectBrackets: 'all',
disallowQuotedKeysInObjects: 'allButReserved',
disallowSpaceAfterObjectKeys: true,
requireCommaBeforeLineBreak: true,
requireOperatorBeforeLineBreak: [ '?', '+', '-', '/', '*', '=', '==', '===', '!=', '!==', '>', '>=', '<', '<=' ],
disallowLeftStickedOperators: [ '?' ],
requireRightStickedOperators: [ '!' ],
requireLeftStickedOperators: [ ',' ],
disallowRightStickedOperators: [ ':' ],
disallowSpaceAfterPrefixUnaryOperators: [ '++', '--', '+', '-', '~', '!' ],
disallowSpaceBeforePostfixUnaryOperators: [ '++', '--' ],
disallowKeywords: [ 'with' ],
disallowMultipleLineStrings: true,
requireDotNotation: true,
requireParenthesesAroundIIFE: true
},
srcModules: [
'src/**/*.js',
'!**/intro.js',
'!**/outro.js'
],
srcLanguages: 'lang/*.js',
tests: {
options: {
// more restrictions.
// we eventually want these to apply to all other code too.
requireSpaceAfterKeywords: [ 'if', 'else', 'for', 'while', 'do', 'switch', 'return', 'try', 'catch' ],
requireSpacesInsideArrayBrackets: 'all',
requireKeywordsOnNewLine: [ 'else', 'catch' ],
disallowTrailingWhitespace: true,
validateQuoteMarks: '\'',
maximumLineLength: 120
},
src: 'tests/automated/*.js'
},
misc: [
'*.js', // ex: Gruntfile.js
'build/*.js' // ex: this file
]
};