cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kam...@apache.org
Subject git commit: Add JSCS config file
Date Wed, 06 Aug 2014 15:51:03 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master c4ab88d4e -> 437eb1264


Add JSCS config file

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:
https://github.com/jshint/jshint/issues/1339

JSCS has recently added the options dropped from JSHint.
https://github.com/mdevils/node-jscs/issues/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


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/437eb126
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/437eb126
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/437eb126

Branch: refs/heads/master
Commit: 437eb12647311eb50878bf4d9095f403fbb8a7ba
Parents: c4ab88d
Author: Mark Koudritsky <kamrik@gmail.com>
Authored: Thu Jul 31 13:42:47 2014 -0400
Committer: Mark Koudritsky <kamrik@gmail.com>
Committed: Wed Aug 6 11:50:15 2014 -0400

----------------------------------------------------------------------
 cordova-lib/.jscs.json | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/437eb126/cordova-lib/.jscs.json
----------------------------------------------------------------------
diff --git a/cordova-lib/.jscs.json b/cordova-lib/.jscs.json
new file mode 100644
index 0000000..5cc7e26
--- /dev/null
+++ b/cordova-lib/.jscs.json
@@ -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"
+    ]
+}


Mime
View raw message