This package includes the shareable ESLint configuration used in all SPA-related Emico projects.
To use this configuration first install this package:
yarn add -D @emico/eslint-config
Then add this to your package.json
:
"eslintConfig": {
"extends": "@emico/eslint-config"
},
The eslintConfig
property is used by create-react-app, IDE extensions and seems to be standard.
Customization is not recommended as all Emico projects should use the same configuration. Please consider making a pull request to this package instead.
To apply custom rules remove the eslint configuration from your package.json
, then create a file named .eslintrc.json
with following contents in the root folder of your project:
{
"extends": "@emico/eslint-config"
}
That's it! You can override the settings by editing the .eslintrc.json
file. Learn more about configuring ESLint on the ESLint website.
These options can be enabled/disabled using env variables.
CODE_STYLE
Enable or disable code style rules in eslint. These rules are
automatically fixable, so this can be run in a precommit hook with --fix
.
EMICO_COMPONENT_LIBRARY
Enable or disable Emico internal component library rules