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-debugger
withno-console
rule.
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 */
console.log('test')
Or you can do this in a code snippet and then re-enable it:
/* 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
More devtools tutorials:
- Yoman Introduction
- Bower, browser package manager
- Introduction to front-end testing
- Use node-webkit to create desktop applications
- VS Code: Use language-specific settings
- Introduction to Webpack
- A short and concise guide to the Tower of Babel
- Yarn introduction
- Overview of Browser DevTools
- Use Prettier to format code
- Use ESLint to keep your code clean
- List of cool Chrome DevTools tips and tricks
- Test JavaScript with Jest
- How to use Visual Studio Code
- Introduction to Electronics
- Package, simpler Webpack
- Emmet's HTML reference
- V8 JavaScript engine
- Configure VS Code
- Configure macOS command line
- How to disable ESLint rules
- How to open VS Code from the command line
- How to set up hot reinstallation on Electron