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

@eslint-react/kit

v5.18.3

Published

ESLint React's utility module for building custom React rules with JavaScript functions.

Readme

@eslint-react/kit

ESLint React's utility module for building custom React rules with JavaScript functions.

[!WARNING] This module is currently in beta. APIs may change in future releases.

Installation

npm install --save-dev @eslint-react/kit

Quick Start

import eslintReactKit, { merge } from "@eslint-react/kit";
import type { RuleFunction } from "@eslint-react/kit";
import { defineConfig } from "eslint/config";

/** Enforce function declarations for function components. */
function functionComponentDefinition(): RuleFunction {
  return (context, { collect }) => {
    const { query, visitor } = collect.components(context);
    return merge(
      visitor,
      {
        "Program:exit"(program) {
          for (const { node } of query.all(program)) {
            if (node.type === "FunctionDeclaration") continue;
            context.report({
              node,
              message: "Function components must be defined with function declarations.",
            });
          }
        },
      },
    );
  };
}

export default defineConfig({
  files: ["**/*.{ts,tsx}"],
  extends: [
    eslintReactKit()
      .use(functionComponentDefinition)
      .getConfig(),
  ],
});

Rules are defined as named functions returning a RuleFunction. The function name is converted to kebab-case and registered under the @eslint-react/kit namespace (functionComponentDefinition@eslint-react/kit/function-component-definition, enabled at "error" severity). Anonymous factories get a random hex name, which makes them impractical to disable via config or disable comments — useful for checks that must never be bypassed.

API Overview

eslintReactKit() (default export)

Creates a chainable Builder for registering custom rules:

| Method | Description | | ----------- | ---------------------------------------------------------------------------------------------------------------------- | | use | Registers a rule factory. The rule name is kebabCase(factory.name); options are inferred from the factory signature. | | getConfig | Returns a flat Linter.Config with the plugin and all registered rules enabled at "error". | | getPlugin | Returns the raw ESLint.Plugin for full control over namespace and severities. |

RuleFunction

type RuleFunction = (context: RuleContext, toolkit: RuleToolkit) => RuleListener;

RuleToolkit

The second argument passed to every rule function:

  • collect — Semantic collectors (components(context, options?), hooks(context)). Each returns a { query, visitor } pair; merge the visitor into your listener and call query.all(program) after traversal (e.g. in Program:exit) to get the detected semantic nodes.
  • is — All predicates, with rule context pre-bound: component checks (componentDecl, componentName, componentWrapperCall, …), hook checks (hookCall, hookDecl, useEffectLikeCall, …), and React API checks (memoCall, createElementCall, every built-in hook call, plus the API(name) / APICall(name) factories for arbitrary APIs).
  • ast — Low-level AST utilities: findParent(node, test) walks up ancestors; unwrap(node) strips TS type-expression wrappers (as, satisfies, !, …) and ChainExpression.
  • hint — Bit-flags controlling what the component collector treats as a component (hint.component.Default, …).
  • flag — Bit-flags describing component characteristics (flag.component.Memo, flag.component.ForwardRef, …).
  • settings — The normalized react-x shared settings (version, importSource, additionalEffectHooks, …), so custom rules react to the same project settings as the built-in rules.

merge

merge(...listeners: RuleListener[]): RuleListener

Merges multiple visitor objects into one; handlers for the same visitor key are chained in order. Essential for combining collector visitors with your own logic.

Documentation

For full documentation, see https://beta.eslint-react.xyz/docs/packages/kit.