Skip to content

Commit

Permalink
Add JSCS config file
Browse files Browse the repository at this point in the history
Don't merge yet - feedback wanted.

JSHint people want to focus on syntax linting and are dropping style oriented
options. They recommends using JSCS (in addition to JSHint) for style:
jshint/jshint#1339

JSCS has recently added the options dropped from JSHint.
jscs-dev/node-jscs#102

This commit contains a JSCS config file with some basic settings that generate
very few errors with the existing cordova-cli and lib code.

Would be glad to get some feedback about this. My goal is to eventually run
JSCS together with JSHint as part of `npm test`. The nice thing about JSCS
is that style flame wars can be way more structured with it as we can argue
about very specific well named JSCS config options :)

I'm using it with SublimeLinter-jscs
https://sublime.wbond.net/packages/SublimeLinter-jscs
  • Loading branch information
kamrik committed Aug 1, 2014
1 parent 4001bd3 commit bad67bd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cordova-lib/.jscs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"validateLineBreaks": "LF",
"validateIndentation": 4,
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"requireSpaceAfterLineComment": true,
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},

"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do"
]
}

0 comments on commit bad67bd

Please sign in to comment.