From b6e0c76c7d6ba7fc22939e5683e0a1dd651f1fd4 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 30 Dec 2014 03:01:58 -0800 Subject: [PATCH] Define a seperate JSHint configuration for NodeJS files Summary: Currently, we assume that all JavaScript files are for use in a browser. This is not true for the NodeJS Aphlict server code. Split the current JSHint configuration into `jshint-browser` and `jshint-node`. Test Plan: `arc lint` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D11071 --- .arclint | 14 +++++++++++-- support/lint/{jshintrc => browser.jshintrc} | 0 support/lint/node.jshintrc | 22 +++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) rename support/lint/{jshintrc => browser.jshintrc} (100%) create mode 100644 support/lint/node.jshintrc diff --git a/.arclint b/.arclint index 36ae3b2b29..98a644d3e3 100644 --- a/.arclint +++ b/.arclint @@ -21,10 +21,20 @@ "(^support/aphlict/)" ] }, - "jshint": { + "jshint-browser": { "type": "jshint", "include": "(\\.js$)", - "jshint.jshintrc": "support/lint/jshintrc" + "exclude": [ + "(^support/aphlict/server/.*\\.js$)" + ], + "jshint.jshintrc": "support/lint/browser.jshintrc" + }, + "jshint-node": { + "type": "jshint", + "include": [ + "(^support/aphlict/server/.*\\.js$)" + ], + "jshint.jshintrc": "support/lint/node.jshintrc" }, "json": { "type": "json", diff --git a/support/lint/jshintrc b/support/lint/browser.jshintrc similarity index 100% rename from support/lint/jshintrc rename to support/lint/browser.jshintrc diff --git a/support/lint/node.jshintrc b/support/lint/node.jshintrc new file mode 100644 index 0000000000..62ee2d22b5 --- /dev/null +++ b/support/lint/node.jshintrc @@ -0,0 +1,22 @@ +{ + "bitwise": true, + "curly": true, + "immed": true, + "indent": 2, + "latedef": true, + "newcap": true, + "noarg": true, + "quotmark": "single", + "undef": true, + "unused": true, + + "expr": true, + "loopfunc": true, + "sub": true, + + "globals": { + "JX": false, + "__DEV__": false + }, + "node": true +}