Skip to content

Instantly share code, notes, and snippets.

@okovalov
Last active December 18, 2019 17:03
Show Gist options
  • Save okovalov/efddd8ea09cbe3105169beb6a85a0252 to your computer and use it in GitHub Desktop.
Save okovalov/efddd8ea09cbe3105169beb6a85a0252 to your computer and use it in GitHub Desktop.

You can disable one or more specific ESLint rules for a whole file by adding on a few lines:

/* eslint-disable no-debugger, no-console */
console.log('test')

or you can just do so in a block, re-enabling it afterwards:

/* eslint-disable no-debugger, no-console */
console.log('test')
/* 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

https://flaviocopes.com/how-to-disable-eslint-rule/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment