Skip to content

Commit

Permalink
Add JSCS config file
Browse files Browse the repository at this point in the history
But not running it as part of `npm test` yet.

See discussion here:
http://markmail.org/thread/rzzvn2ax3tqzabfw

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.

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 6, 2014
1 parent 69943e1 commit f78a7c6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"validateLineBreaks": "LF",
"validateIndentation": 4,
"requireLineFeedAtFileEnd": true,

"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"requireSpaceAfterLineComment": true,
"requireCapitalizedConstructors": true,

"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},

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

0 comments on commit f78a7c6

Please sign in to comment.