Skip to content

Commit f77e9e4

Browse files
committed
Add JSCS
1 parent 1ef97a3 commit f77e9e4

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

.jscsrc

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"requireCurlyBraces": [
3+
"if",
4+
"else",
5+
"for",
6+
"while",
7+
"do",
8+
"try",
9+
"catch",
10+
"case",
11+
"default"
12+
],
13+
"requireSpaceAfterKeywords": [
14+
"if",
15+
"else",
16+
"for",
17+
"while",
18+
"do",
19+
"switch",
20+
"return",
21+
"try",
22+
"catch"
23+
],
24+
"requireSpaceBeforeBlockStatements": true,
25+
"requireParenthesesAroundIIFE": true,
26+
"requireSpacesInConditionalExpression": true,
27+
"requireSpacesInFunctionExpression": {
28+
"beforeOpeningCurlyBrace": true
29+
},
30+
"disallowSpacesInFunctionExpression": {
31+
"beforeOpeningRoundBrace": true
32+
},
33+
"disallowMultipleVarDecl": true,
34+
"requireBlocksOnNewline": 1,
35+
"disallowPaddingNewlinesInBlocks": true,
36+
"disallowEmptyBlocks": true,
37+
"disallowSpacesInsideArrayBrackets": true,
38+
"disallowSpacesInsideParentheses": true,
39+
"requireSpacesInsideObjectBrackets": "all",
40+
"disallowQuotedKeysInObjects": "allButReserved",
41+
"disallowSpaceAfterObjectKeys": true,
42+
"requireCommaBeforeLineBreak": true,
43+
"disallowSpaceAfterPrefixUnaryOperators": true,
44+
"disallowSpaceBeforePostfixUnaryOperators": true,
45+
"requireSpaceBeforeBinaryOperators": true,
46+
"requireSpaceAfterBinaryOperators": true,
47+
"disallowImplicitTypeConversion": ["numeric", "boolean", "binary", "string"],
48+
"requireCamelCaseOrUpperCaseIdentifiers": true,
49+
"disallowMultipleLineBreaks": true,
50+
"validateLineBreaks": "LF",
51+
"validateQuoteMarks": "'",
52+
"validateIndentation": 4,
53+
"disallowMixedSpacesAndTabs": true,
54+
"disallowTrailingWhitespace": true,
55+
"disallowTrailingComma": true,
56+
"disallowKeywordsOnNewLine": ["else"],
57+
"requireLineFeedAtFileEnd": true,
58+
"maximumLineLength": 120,
59+
"requireDotNotation": true,
60+
"disallowYodaConditions": true,
61+
"validateJSDoc": {
62+
"checkParamNames": true,
63+
"checkRedundantParams": true,
64+
"requireParamTypes": true
65+
},
66+
"requireSpaceAfterLineComment": true,
67+
"disallowNewlineBeforeBlockStatements": true
68+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "Convert markup in text form to JSONML",
55
"main": "index.js",
66
"scripts": {
7-
"validate": "jshint index.js test",
7+
"jshint": "jshint index.js test",
8+
"jscs": "jscs index.js test",
9+
"validate": "npm run jshint && npm run jscs",
810
"testling": "browserify -t brfs test/test.js | testling",
911
"test": "cd test; covert test.js && ./cli.sh"
1012
},
@@ -38,6 +40,7 @@
3840
"brfs": "^1.2.0",
3941
"browserify": "^5.9.1",
4042
"covert": "^0.4.0",
43+
"jscs": "^1.5.9",
4144
"jshint": "^2.5.3",
4245
"tape": "^2.13.4",
4346
"testling": "^1.7.0"

0 commit comments

Comments
 (0)