@hero-design/eslint-plugin
v9.2.0
Published
Hero Design's eslint plugin
Downloads
6,697
Readme
@hero-design/eslint-plugin
Hero Design's eslint plugin to ensure correct usage and deprecation of our packages.
We strongly recommend all of our consumers to use this plugin with our predefined recommendedRn
config.
Installation
You'll first need to install ESLint:
yarn add -D eslint
Next, install @hero-design/eslint-plugin
:
yarn add -D @hero-design/eslint-plugin
Usage
Add @hero-design
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin
postfix:
{
"plugins": ["@hero-design"]
}
Then, you can either:
- Use our pre-defined config by adding
plugin:@hero-design/recommendedRn
underextends
section. This approach is strongly recommended as it requires no configurations.
{
"extends": ["plugin:@hero-design/recommendedRn"]
}
- Configure the rules you want to use under the
rules
section. This approach should be avoided in most of the cases unless you have any specific needs.
{
"rules": {
"@hero-design/rule-name": 2
}
}
Supported Rules
| Rule | Description | | ----------------------------------------------- | ------------------------------------------- | | @hero-design/no-deprecated-component-prop | Disallow deprecated component props | | @hero-design/no-deprecated-component-prop-value | Disallow deprecated component prop's values | | @hero-design/no-deprecated-theme-key | Disallow deprecated theme keys | | @hero-design/not-recommended-import | Disallow not recommended imports |