Page MenuHomePhabricator

Be more strict with JSHint.
ClosedPublic

Authored by joshuaspence on Jun 22 2014, 5:25 PM.
Tags
None
Referenced Files
F14061002: D9659.diff
Mon, Nov 18, 4:35 AM
F14045471: D9659.diff
Wed, Nov 13, 4:49 AM
F14038208: D9659.id23189.diff
Sun, Nov 10, 10:09 PM
F14037112: D9659.id23189.diff
Sun, Nov 10, 1:54 PM
F14034579: D9659.id.diff
Sun, Nov 10, 1:05 AM
F14032462: D9659.diff
Sat, Nov 9, 2:29 PM
F14032306: D9659.id23197.diff
Sat, Nov 9, 2:01 PM
F14032165: D9659.diff
Sat, Nov 9, 1:09 PM
Subscribers

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rPfcaeb2aeb6d9: Be more strict with JSHint.
Summary

Add a bunch of extra checks to be performed by jshint. For documentation, see http://jshint.com/docs/options/.

Test Plan

Ran jshint --config support/jshint/jshintconfig webroot/rsrc/js/. There were a bunch of existing violations, but some of these are legitimate and probably require attention.

{
  "bitwise": true, // 0 violations
  "curly": true, // 0 violations
  "immed": true, // 1 violation
  "indent": 2, // 0 violations
  "latedef": true, // 10 violations
  "newcap": true, // 1 violation
  "noarg": true, // 0 violations
  "quotmark": "single", // 55 violations
  "undef": true, // 24 violations
  "unused": true, // 107 violations

  "expr": true,
  "loopfunc": true,
  "sub": true,

  "globals": {
    "JX": false,
    "__DEV__": false
  },
  "browser": true
}

Diff Detail

Repository
rP Phabricator
Branch
jshint
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1294
Build 1294: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Be more strict with JSHint..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 22 2014, 5:30 PM

Just confirming... you're happy with this even though it introduces a bunch of linter errors?

support/jshint/jshintconfig
21

We may want a separate JSHint configuration file for NodeJS?

Yep, that's fine -- we can clean deal with them as we go.

I think it's probably fine not to warn about use of document, etc., in Node.js code -- we share some code anyway. We could split things out if there's an issue.

joshuaspence updated this revision to Diff 23197.

Closed by commit rPfcaeb2aeb6d9 (authored by @joshuaspence).