Turning off eslint rule for a specific line

runtimeZero picture runtimeZero · Jan 1, 2015 · Viewed 858.5k times · Source

In order to turn off linting rule for a particular line in JSHint we use the following rule:

/* jshint ignore:start*/
$scope.someVar = ConstructorFunction();
/* jshint ignore:end */

I have been trying to locate the equivalent of the above for eslint.

Answer

goofballLogic picture goofballLogic · Apr 12, 2015

To disable next line:

// eslint-disable-next-line no-use-before-define
var thing = new Thing();

Or use the single line syntax:

var thing = new Thing(); // eslint-disable-line no-use-before-define

See the eslint docs