7
votes

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 ?

2
go to '/path-to/node_modules' and check "eslint-plugin" is there are not?? in "package.json" alsoo. This link might help. stackoverflow.com/questions/13066532/… - PALLAMOLLA SAI
eslint-disable plugin you can find here. npmjs.com/package/eslint-plugin-disable - PALLAMOLLA SAI
First install package eslint-config-airbnb-base which will give you the base eslint airbnb package and then install eslint-plugin-react. This way you don't have to install eslint-plugin-jsx-a11y. Hope that helps!! - tarzen chugh
Sure I will try this, Thanks !! - user1441238

2 Answers

5
votes

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):

  1. Search and delete in extends (if you have it) plugin:jsx-a11y/recommended.
  2. Search and delete in plugins: jsx-a11y.
  3. Then in rules delete every rule that involes jsx-a11y (Eg: "jsx-a11y/rule-name": 2).
  4. Finally you can delete it from the project: 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)

-2
votes

Try to install the latest version of react-scripts

If this doesn't work, try updating all the way to the latest one 1.0.10, updated the react and react-dom in my package.json, deleted the package-lock.json and re-installed node_modules.