Software

QUnit rules for JSHint

Exclusions for QUnit variable and function names

While updating the Uni-Form CSS project to use Grunt, I changed some of the settings for the linter, and for the first time, added lint rules for the unit test files. Grunt uses JSHint, and by default uses rules that are a bit more strict than I had used previously. In addition, the global variables from the QUnit tests were polluting the global namespace, and so I had to tell lint to ignore those.

Here’s the final lint rules that I added to the test files, I hope they may be useful to someone else:

/*global QUnit:true, module:true, test:true, asyncTest:true, expect:true*/
/*global start:true, stop:true ok:true, equal:true, notEqual:true, deepEqual:true*/
/*global notDeepEqual:true, strictEqual:true, notStrictEqual:true, raises:true*/

Return to top