Page MenuHomePhabricator

Be more strict with JSHint.
ClosedPublic

Authored by joshuaspence on Jun 22 2014, 5:25 PM.
Tags
None
Referenced Files
F19153508: D9659.diff
Thu, Dec 11, 10:16 AM
F18891751: D9659.diff
Nov 7 2025, 11:00 AM
F18849978: D9659.diff
Oct 30 2025, 1:35 PM
F18790172: D9659.id.diff
Oct 15 2025, 12:50 PM
F18396567: D9659.id.diff
Aug 29 2025, 12:28 PM
F18377117: D9659.diff
Aug 28 2025, 12:08 PM
F17727065: D9659.id23197.diff
Jul 18 2025, 11:47 PM
F17726615: D9659.id.diff
Jul 18 2025, 3:50 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).