I've placed a .eslintignore
file in the root of my create-react-app installation, so I can ignore warnings from vendor libs.
It works fine if I run eslint from the commandline:
./node_modules/.bin/eslint src/js/vendor/jquery.js
...warnings ignored...
However running npm start
and npm run build
seem to ignore the ignore file.
How can I achieve what I want to do here - without editing individual vendor files to add eslint options?
This was fixed with this commit in CRA codebase: https://github.com/facebook/create-react-app/commit/6f5221c2d7df0b7a097cfdd461967422c3013e12#diff-dc0c4e7c623b73660da1809fc60cf6ba
Simply add EXTEND_ESLINT=true
to a .env
file in your project root.
YES .eslintignore is ignored. According to this issue.
CRA 1.x+ purposely does not support .eslintignore. Sorry!
Workarround
add /* eslint-disable */
to the beginning of the file.
move vendor files into public/
or use a NPM package.
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