To temporarily disable rule warnings in your file, use block comments in the following format:
/* eslint-disable */
alert('foo');
/* eslint-enable */
You can also disable or enable warnings for specific rules:
/* eslint-disable no-alert, no-console */
alert('foo');
console.log('bar');
/* eslint-enable no-alert, no-console /
To disable rule warnings in an entire file, put a / eslint-disable */ block comment at the top of the file:
/* eslint-disable */
alert('foo');
You can also disable or enable specific rules for an entire file:
/* eslint-disable no-alert */
alert('foo');
To disable all rules on a specific line, use a line comment in one of the following formats:
Following are some examples to disable ESLint for a page
alert('foo'); // eslint-disable-line
// eslint-disable-next-line
alert('foo');
To disable a specific rule on a specific line:
alert('foo'); // eslint-disable-line no-alert
// eslint-disable-next-line no-alert
alert('foo');
To disable multiple rules on a specific line:
alert('foo'); // eslint-disable-line no-alert, quotes, semi
// eslint-disable-next-line no-alert, quotes, semi
alert('foo');
Do following steps to disable ESLint from your project
- open package.config file in your project.
- remove all dependencies related to ESLint.
- remove eslint.js/eslintconfig files from your project
- run command npm install
- now run your project