Linting commit
Antranig Basman
antranig.basman at colorado.edu
Mon Apr 14 04:35:44 UTC 2014
I've taken the liberty of following my last suggestion and capping our JSHint version at what in npm is
called ~2.4.0 which will currently pull in version 2.4.4 of jshint - this more or less provides what we need
in terms of whitespace checking and a reasonably low quantity of bugs.
This was done by setting our grunt-contrib-jshint npm version to ~0.9.0. This will continue to work unless
either the plugin or jshint release a minor update which backports the whitespace removal. This seems an
unlikely result - in that case we would probably have no alternative to fork both projects to freeze their
versions at an appropriate point. npm does include a facility which in theory could help us here by the name
of "npm shrinkwrap" but from reading the docs it seems to make too many assumptions about the project
versioning structure to be applicable to our case of just wanting to freeze the version of one dev
dependency. It is a possible avenue to research though.
This result is not quite ideal since the revision of jshint that we would really want is this one:
https://github.com/jshint/jshint/commit/bf886b8f07124ddfbef158d7269e7b3b184a65fe
This fixes a bug that stops jshint ignore:line from being able to counteract the effect of an unused
parameter warning. Unfortunately this revision was not assigned a version number (it falls between 2.4.4 and
2.5.0), and the commits to eliminate whitespace support follow directly afterwards. In order to compensate
for this, I adjusted the several lines where this ignore was applied to instead include the unused parameter
in a comment. I also fixed up a case of trailing whitespace that already reappeared in the framework during
the couple of days we ran with a jshint which didn't detect it :)
These decisions are easily revisited - I thought it best to push this now since this is a change that will
conflict with any outstanding work and it is best that we push ahead as best we can, especially since Justin
will be away for the next couple of weeks. Could all those who have outstanding pull requests please now
update them against master since probably 1 line in 5 of our codebase has been affected by these linting
changes.
Thanks to Justin for steadfastly and consistently pushing through the long work necessary to get this
improvement made -
Cheers,
A
More information about the fluid-work
mailing list