JSHint and whitespace

Antranig Basman antranig.basman at colorado.edu
Fri Apr 11 23:42:39 UTC 2014


As Justin and I observed in the IRC channel today, jshint has removed all options and capabilities relating 
to whitespace.

The developer explains that this change is permanent and complete:

http://javascriptjabber.com/082-jsj-jshint-with-anton-kovalyov/

I was unable to find the blog posting he refers to in the transcript in which he claims he announced this 
change.

He recommends a tool named "jscs" for stylistic issues including whitespace. We could consider adding a 
further grunt task for this (at the cost of making our somewhat slow lint checking yet slower). It also has 
a SublimeText plugin

https://github.com/mdevils/node-jscs

Unfortunately this tool is bristling with options in which it seems unprofitable to make a great investment. 
Another option is to freeze the version of jshint we use at an earlier revision which had support both for 
"ignore" as well as "trailing" -

It appears that this feature ("ignore") was added at revision
https://github.com/jshint/jshint/commit/4921d720215126ed5c7c005ac728b2215e9c5e94
of about 6 months ago

whereas the block of commits which started to remove whitespace support started only a few weeks ago at 
March 26th, for example

https://github.com/jshint/jshint/commit/4035fef1af4ef426e9dc99918ca3aac0ce44b784

This leaves a substantial window of jshint releases which should be good for us - say from 2.2.0 up to 2.4.4

Personally I'm in favour of this option since I don't suppose we really want a linter that is a "moving 
target" - should we have once succeeded in linting a file with particular options we don't really want fresh 
issues emerging or old checks failing.

Alternatively we could abandon the expectation of regularity in whitespace, with the risk that abominations 
such as my occasional 3-space indents and rampant trailing whitespace start to proliferate once more :)

Cheers,
A




More information about the fluid-work mailing list