npm

@hero-design/eslint-plugin

9.2.0 • Public • Published

@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:

  1. Use our pre-defined config by adding plugin:@hero-design/recommendedRn under extends section. This approach is strongly recommended as it requires no configurations.
{
  "extends": ["plugin:@hero-design/recommendedRn"]
}
  1. 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

Package Sidebar

Install

npm i @hero-design/eslint-plugin

Weekly Downloads

2,288

Version

9.2.0

License

ISC

Unpacked Size

58.6 kB

Total Files

26

Last publish

Collaborators

  • haudao-eh
  • ttkien_eh
  • ehrocks-dev