Skip to content

Commit cf2dd70

Browse files
committed
Add JSCS style rules
1 parent 1f556f2 commit cf2dd70

File tree

6 files changed

+272
-185
lines changed

6 files changed

+272
-185
lines changed

.jscs.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"requireSpaceAfterKeywords": [
3+
"if", "else", "for", "while", "do", "switch", "return"
4+
],
5+
"disallowSpacesInFunctionExpression": {
6+
"beforeOpeningRoundBrace": true,
7+
"beforeOpeningCurlyBrace": true
8+
},
9+
"disallowSpacesInsideObjectBrackets": true,
10+
"disallowSpacesInsideArrayBrackets": true,
11+
"disallowSpacesInsideParentheses": true,
12+
"disallowQuotedKeysInObjects": "allButReserved",
13+
"disallowSpaceAfterObjectKeys": true,
14+
"disallowLeftStickedOperators": [
15+
"?", "==", "===", "!=", "!==", ">", ">=", "<", "<="
16+
],
17+
"disallowRightStickedOperators": [
18+
"?", "==", "===", "!=", "!==", ">", ">=", "<", "<="
19+
],
20+
"requireLeftStickedOperators": [","],
21+
"requireRightStickedOperators": ["!"],
22+
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"],
23+
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
24+
"validateLineBreaks": "LF",
25+
"requireKeywordsOnNewLine": ["else", "return", "break", "delete"],
26+
"requireLineFeedAtFileEnd": true
27+
}

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
install:
2-
- npm install -g jshint
2+
- npm install -g jshint jscs
33
before_script:
44
- cd ./tests
55
- echo "new Date().toString();" | phantomjs
66
script:
77
- jshint ../js/bootstrap-datepicker.js ../js/locales/*.js
8+
- jscs -c ../.jscs.json ../js/bootstrap-datepicker.js ../js/locales/*.js
89
- phantomjs run-qunit.js tests.html

0 commit comments

Comments
 (0)