eslint-config-react-app-friendly
This package includes shareable ESLint config extends on eslint-config-react-app
and eslint-config-airbnb
, where AirBnB rules are cherry-picked to include only useful ones. It encourages better code without enforcing opinions.
General guidelines:
- Linting must not step in developer's way. Configuration should require minimum effort with no-frills, out of the box experience.
- Errors should only be used to eliminate potential bugs or invalid code.
- Warnings must only be for code that can be improved. Ideally fixing them will be linting tool's job.
- All formatting and stylistic choices should be done by
prettier
. This could be handled automatically by the editor itself, or the CI pipeline. - If given code practice is discouraged, it should be warning at most.
Install
npm install --save-dev eslint-config-react-app-friendly
For non Create React App
projects eslint-config-react-app and its dependencies must be installed too.
Config
// .eslintrc.json
{
extends: ["react-app", "react-app-friendly"]
}
For Create React App
projects an additional environment variable must be set:
// .env
EXTEND_ESLINT=true