I have eslint (of Airbnb coding style) setup for my React project, which has dependency of "eslint-plugin-jsx-a11y", which I do not want for my current project.
My question how to remove this specific plugin "eslint-plugin-jsx-a11y".
When I uninstall "eslint-plugin-jsx-a11y" it gives error following error:
"Failed to load plugin jsx-a11y: Cannot find module 'eslint-plugin-jsx-a11y'"
Is there any way to solve above issue ?
To temporarily turn off ESLint, you should add a block comment /* eslint-disable */ before the lines that you're interested in: /* eslint-disable */ console.
How do I get rid of ESLint? Basically, just delete . eslintrc and any other eslint config files(if any) from the project. Also, check your package.
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs. In many ways, it is similar to JSLint and JSHint with a few exceptions: ESLint uses Espree for JavaScript parsing.
First of all, you will need to remove the references to the plugin (eslint-plugin-jsx-a11y
) on your .eslintrc
(That's why when you uninstall it you eslint config is giving you an error):
extends
(if you have it) plugin:jsx-a11y/recommended
.plugins
: jsx-a11y
.rules
delete every rule that involes jsx-a11y
(Eg: "jsx-a11y/rule-name": 2
).npm uninstall eslint-plugin-jsx-a11y --save-dev
.PS: If you have any disable
statement for eslint-plugin-jsx-a11y
, remember to delete it (they won't be necessary anymore)
The answer of Alberto Perez is valid if you include jsx-a11y
plugin explicitly. But if you extend another plugin that contains jsx-a11y
his approach doesn't work.
If so you can use this:
https://github.com/mradionov/eslint-plugin-disable
At the moment it doesn't support eslint@8
.
See the issue.
https://github.com/airbnb/javascript/issues/2032#issuecomment-568934232
const a11yOff = Object.keys(require('eslint-plugin-jsx-a11y').rules)
.reduce((acc, rule) => { acc[`jsx-a11y/${rule}`] = 'off'; return acc }, {})
module.exports = {
rules: {
...a11yOff,
// your rules
},
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With