npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hero-design/eslint-plugin

v9.2.2

Published

Hero Design's eslint plugin

Downloads

4,293

Readme

@hero-design/eslint-plugin

Overview

Hero Design's ESLint plugin that ensures correct usage and deprecation of Hero Design packages. The plugin is used across many repositories to enforce best practices, prevent deprecated API usage, and maintain consistency across projects using @hero-design/rn, @hero-design/react, and @hero-design/colors.

Key features:

  • Enforces proper component prop usage and prevents deprecated APIs
  • Prevents direct color palette access in favor of semantic tokens
  • Ensures text content is properly wrapped in Typography components
  • Blocks not recommended imports with helpful migration messages
  • Provides pre-configured rule sets for React Native and React web projects

We strongly recommend all consumers to use this plugin with our predefined recommendedRn or recommendedReact configs.

Installation

Prerequisites:

  • Node.js >= 14.17.0 (or >= 20.0.0 recommended)
  • ESLint >= 7.0.0

Install ESLint (if not already installed):

yarn add -D eslint

Install @hero-design/eslint-plugin:

yarn add -D @hero-design/eslint-plugin

Usage

Add @hero-design to the plugins section of your ESLint configuration (.eslintrc). You can omit the eslint-plugin postfix:

{
  "plugins": ["@hero-design"]
}

Recommended Configurations

For React Native Projects

Use the recommendedRn config, which includes rules for deprecated props, theme keys, and not recommended imports:

{
  "extends": ["plugin:@hero-design/recommendedRn"]
}

For React Web Projects

Use the recommendedReact config, which includes rules for color palette access and typography:

{
  "extends": ["plugin:@hero-design/recommendedReact"]
}

For Internal Teams (Next Version Migration)

Use the internalRn config to prepare for upcoming breaking changes:

{
  "extends": ["plugin:@hero-design/internalRn"]
}

Manual Rule Configuration

You can also configure individual rules manually, though this approach should be avoided unless you have specific needs:

{
  "rules": {
    "@hero-design/no-deprecated-component-prop": "error",
    "@hero-design/no-direct-color-palette-access": "warn"
  }
}

Examples

Basic Setup

// .eslintrc.json
{
  "extends": [
    "eslint:recommended",
    "plugin:@hero-design/recommendedRn"
  ],
  "plugins": ["@hero-design"]
}

React Native Component Usage

The plugin will catch deprecated props and suggest alternatives:

// ❌ Incorrect - will be flagged
import { Card } from '@hero-design/rn';
<Card variant="outlined" />

// ✅ Correct
<Card appearance="outlined" />

Color Usage

// ❌ Incorrect - direct palette access
const color = theme.colors.palette.redLight30;

// ✅ Correct - semantic color tokens
const color = theme.colors.text.primary;

Typography Usage (React Web)

// ❌ Incorrect - raw HTML text elements
<div>
  <p>Some text</p>
</div>

// ✅ Correct - Typography component
<div>
  <Typography tagName="p">Some text</Typography>
</div>

Supported Rules

| Rule | Description | Config | |------|-------------|--------| | @hero-design/banning-snowflake-approve-comment | Disallow Snowflake Guard approval comments | - | | @hero-design/no-deprecated-component-prop | Disallow deprecated component props | - | | @hero-design/no-deprecated-component-prop-next | Disallow props deprecated in next version | internalRn | | @hero-design/no-deprecated-component-prop-value | Disallow deprecated component prop values | - | | @hero-design/no-deprecated-theme-key | Disallow deprecated theme keys | - | | @hero-design/no-direct-color-palette-access | Disallow direct color palette access | recommendedReact | | @hero-design/not-recommended-import | Disallow not recommended imports | recommendedRn | | @hero-design/react-no-text-outside-typography | Require text inside Typography component | recommendedReact |

For detailed documentation on each rule, see the docs/rules directory.

Contributing

To contribute to this plugin:

  1. Add a new rule: Create a new rule file in lib/rules/ following the existing pattern
  2. Add tests: Create corresponding test files in tests/lib/rules/
  3. Add documentation: Create a markdown file in docs/rules/ explaining the rule
  4. Update configs: Add the rule to appropriate configs in lib/index.js
  5. Run tests: Execute yarn test to ensure all tests pass
  6. Run linter: Execute yarn lint to check code quality

See the existing rules for examples of the expected structure and patterns.