How to disable ESLint rules

A quick tutorial on how to disable ESLint rules

What can you do to disable oneESLintRules that may be automatically set by your tool?

Consider your tool settingsno-debuggerwithno-consolerule.

The production code may be justified, but in the development mode, it has the ability to access the codeBrowser debuggerwithConsole APIIs essential.

You can disable one or more specific ESLint rules for the entire file by adding the following lines:

/* eslint-disable no-debugger, no-console */

Or you can do this in a code snippet and then re-enable it:

/* eslint-disable no-debugger, no-console */
/* eslint-enable no-alert, no-console */

Or, you can disable the rule on a specific line:

console.log('test') // eslint-disable-line no-console
debugger // eslint-disable-line no-debugger
alert('test') // eslint-disable-line no-alert

More devtools tutorials: