Package Exports
- @wezom/eslint-config-react
- @wezom/eslint-config-react/.eslintrc.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wezom/eslint-config-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@wezom/eslint-config-react
ESLint shareable config for React based on the @wezom/eslint-config
Rules
See full list of extends with code examples
Usage
We strongly recommend using this config with Prettier together.
See description.
Install
npm i -D eslint babel-eslint @wezom/eslint-config-react eslint-config-prettier
Setup linter
.eslintrc.json (parser babel-eslint is optional, you can use whatever you want)
{
"extends": ["@wezom/eslint-config-react", "prettier"],
"parser": "babel-eslint"
}
Add npm scripts
package.json
{
"scripts": {
"test": "npm run prettier && npm run eslint",
"eslint": "eslint src/**/*.{js,jsx}",
"eslint:autofix": "npm run eslint -- --fix",
"prettier": "prettier src/ --check",
"prettier:autofix": "npm run prettier -- --write"
}
}
Test your files
npm run test