Page MenuHomePhabricator

Be more strict with JSHint.
ClosedPublic

Authored by joshuaspence on Jun 22 2014, 5:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 4:37 AM
Unknown Object (File)
Sun, Dec 15, 10:23 AM
Unknown Object (File)
Fri, Dec 13, 8:49 PM
Unknown Object (File)
Thu, Dec 12, 11:10 AM
Unknown Object (File)
Nov 18 2024, 4:35 AM
Unknown Object (File)
Nov 13 2024, 4:49 AM
Unknown Object (File)
Nov 10 2024, 10:09 PM
Unknown Object (File)
Nov 10 2024, 1:54 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
Lint
Lint Skipped
Unit
Tests Skipped

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).