Package Exports
- @bedrockstreaming/eslint-config-react
- @bedrockstreaming/eslint-config-react/index.js
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 (@bedrockstreaming/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
@bedrockstreaming/eslint-config-react
The purpose of this package is simple, simplify the configuration of eslint and prettier in our projects.
It provides:
- @bedrockstreaming/eslint-config which inherits from eslint-config-airbnb
- eslint itself
- prettier with all the plugins needed to work with eslint
- eslint-plugin-react-hooks
With that come some little changes from the default config of eslint-config-airbnb and prettier that you can find in index.js file and [here].
Setup
npm install --dev @bedrockstreaming/eslint-config-reactor
yarn add --dev @bedrockstreaming/eslint-config-reactThen you need to add the config in the .eslintrc file of your project. For that create a .eslintrc and add the following lines:
{
"extends": "@bedrockstreaming/eslint-config-react"
}And that's all.
If you want to customize some rules, follow the eslint documentation.
Jest / Jasmine Support
If you want, you can add the jest support with the following lines:
{
"env": {
"browser": true,
"jasmine": true
}
}Usage
Lint your code:
yarn eslint src/Rewrite your code, the right way 😈:
yarn prettier-eslint -- --write 'src/**/*.js'