Search code examples
eslintstandardjs

Disabling all React related lint warnings on ESLint


I am working on a project which uses JSX without React. ESLint thinks I am using React because of JSX, how can I disable all React related linter warnings?

For example, I am having these warnings:

Standard: error
Missing "key" prop for element in iterator (react/jsx-key)

Standard: error
Empty components are self-closing (react/self-closing-comp)

Is there a way I can disable all the warnings that start with react?

Thank you.


Solution

  • Look into eslint documentaion ESLint official docs, the only way you can disable react/*** rules is by creating .eslintrc file and disabling the rules explicitly.

    Another work around for it would be to remove the npm package of eslint-plugin-react which will remove the React ESLint rules totally and you won't have to explicitly disable the rules in .eslintrc file.