JSHint is configured with inline /* jshint ... */ directives.

Introduction

Relaxing

Enable these options to not throw errors in these conditions.

/* jshint asi: true */
allow()
missing_semicolons()
/* jshint boss: true */
if (m = str.match(/.../))
/* jshint debug: true */
debugger;
/* jshint eqnull: true */
if (x == null)
/* jshint evil: true */
eval('...')
/* jshint expr: true */
production && minify = true;
div.innerWidth;
expect(x).be.true;
/* jshint laxcomma: true */     // (deprecated)
var one = 1
  , two = 2;
/* jshint sub: true */          // (deprecated)
process.env['name_here']
/* jshint loopfunc: true */
for (i = 0; i < 10; i++) {
  (function(i) { ... })(i);
}
/* jshint strict: "global" */
"use strict";

See: Relaxing options (jshint.com)

Enforcing

Enable these options to catch more errors.

/* jshint curly: true */
while (day)                     // err: use { }'s
  shuffle();
/* jshint eqeqeq: true */
if (a == null)                  // err: use ===
/* jshint esversion: 3 */
// ...for legacy IE compatibility
a.default = function() { ... }; // err: reserved word
array = [ 1, 2, 3, ];           // err: extra comma
/* jshint forin: true */
for (key in obj) { ... }        // err: check obj.hasOwnProperty(key)
/* jshint freeze: true */
Array.prototype.count = ...;    // err: don't modify native prototypes
/* jshint esversion: 6 */
const sum = (a, b) => a + b     // allow ES6 syntax
/* jshint quotmark: single */   // (deprecated)
/* jshint quotmark: double */
alert("hi");                    // err: only single allowed
/* jshint strict: true */
function() { ... }              // err: need "use strict"
/* jshint indent: 4, maxlen: 80 */  // (deprecated)
/* jshint maxdepth: 2 */
/* jshint maxparams: 3 */
/* jshint maxstatements: 4 */
/* jshint maxcomplexity: 5 */

See: Enforcing options (jshint.com)

Ignore

/* jshint ignore:start */
/* jshint ignore:end */

See: Inline configuration (jshint.com)

Globals and environments

/* jshint undef: true */
/* globals jQuery */
/* globals -BAD_LIB */
/* jshint devel: true */   console, alert, ...
/* jshint browser: true */ window, document, location, ...
/* jshint node: true */    module, exports, console, process, ...
/* jshint jquery: true */  jQuery, $

See: Environments (jshint.com)

Also see

0 Comments for this cheatsheet. Write yours!