Disable ESLint for a Single File

Configuring and setting up ESLint is an awesome thing to do when you are starting up a project. But, sometimes you don’t want to add an exception for a single file.

Just add the following comment above the codeblock that you want eslint to ignore.

1
/* eslint-disable */

Note the single astrisk after /.

You can also try to disable eslint for a single block of code and not a single file by doing the following:

1
2
3
4
5
/* eslint-disable */
function doStuff() { /** do something here that eslint doesn't like */}
/* eslint-disable */

function doSomethingElse() { /** eslint works here and shows the error/warnings */}