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-plugin-sweepit

v0.0.21

Published

Opinionated architectural lint rules for Sweepit.

Readme

eslint-plugin-sweepit

Opinionated architectural lint rules.

Install

npm install --save-dev eslint-plugin-sweepit eslint

Usage (Flat config)

import sweepit from 'eslint-plugin-sweepit';

export default [...sweepit.configs.core, ...sweepit.configs.react];

Type Information (Accuracy Boost)

configs.core and configs.react enable TypeScript project services by default:

languageOptions: {
  parserOptions: {
    projectService: true,
    tsconfigRootDir: process.cwd(),
  },
}

This improves accuracy for rules like:

  • sweepit/no-array-props
  • sweepit/no-object-props
  • sweepit/no-optional-props-without-defaults
  • @typescript-eslint/no-floating-promises
  • @typescript-eslint/switch-exhaustiveness-check

What configs.core includes

The exported core config enables:

  • all rules from typescript-eslint recommended and recommendedTypeChecked flat configs
  • functional/immutable-data
  • no-param-reassign with { props: true }
  • prefer-const
  • @typescript-eslint/switch-exhaustiveness-check
  • sweepit/no-external-binding-mutation
  • sweepit/complexity with { max: 5, variant: 'modified' }

What configs.react includes

The exported React config is opinionated. It enables:

  • Third-party React/TS plugins:
    • eslint-plugin-react
    • eslint-plugin-react-hooks
    • eslint-plugin-react-you-might-not-need-an-effect
    • typescript-eslint (flat plugin + parser APIs)
  • Third-party rules:
    • react/jsx-handler-names
    • react/jsx-no-constructed-context-values
    • react/jsx-no-useless-fragment
    • react/jsx-pascal-case
    • react/no-unstable-nested-components
    • @typescript-eslint/no-floating-promises
    • all rules from eslint-plugin-react-hooks recommended config
    • all rules from eslint-plugin-react-you-might-not-need-an-effect recommended config
  • Sweepit rules listed below (all as error in the default config)

Customize rule defaults

Override any default rule from sweepit.configs.core and sweepit.configs.react.

import sweepit from 'eslint-plugin-sweepit';

export default [
  ...sweepit.configs.core,
  ...sweepit.configs.react,
  {
    rules: {
      // disable a default rule
      'react-hooks/exhaustive-deps': 'off',
      // tune sweepit rules
      'sweepit/no-array-props': 'warn',
      'sweepit/no-prefixed-prop-bundles': ['error', { threshold: 4 }],
    },
  },
];

Included rules

| Rule | Description | | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | sweepit/no-title-case-props | Disallows TitleCase JSX props and enforces camelCase prop names. | | sweepit/no-custom-kebab-case-props | Disallows custom kebab-case JSX props (except allowed prefixes like aria-* and data-*). | | sweepit/no-set-prefix-utils | Reserves set* naming for useState setters, not utility/helper functions. | | sweepit/no-handle-prefix-utils | Reserves handle* naming for functions used in JSX on* props, not general utility/helper functions. | | sweepit/no-useless-hook | Disallows use* functions that do not call a real React hook. | | sweepit/no-hook-jsx | Disallows hooks returning JSX; use* should return behavior/data, not markup. | | sweepit/no-exported-context-hooks | Disallows exporting use*Context hooks to keep context internals private. | | sweepit/no-handler-return-type | Enforces void return types for on* handler prop contracts. | | sweepit/jsx-server-action-prop-suffix | Requires async callback props to be named action or end with Action. | | sweepit/jsx-on-handler-verb-suffix | Ensures on* handler prop names end with a verb (for example onValueChange). | | sweepit/no-render-helper-functions | Disallows JSX-returning functions unless they use PascalCase component naming. | | sweepit/no-element-props | Restricts ReactNode/ReactElement prop usage to explicit composition conventions (children/render). | | sweepit/no-componenttype-props | Disallows ComponentType/FC/FunctionComponent props in component contracts. | | sweepit/no-object-props | Disallows object-typed members in *Props type definitions (except style). | | sweepit/no-array-props | Disallows array/tuple-typed members in *Props type definitions. | | sweepit/no-prefixed-prop-bundles | Treats grouped prefixed prop declarations (for example userName/userEmail/userRole) as a composition-pressure signal once they hit a configured threshold (default 3). | | sweepit/no-return-object-repetition | Flags repeated object-return key shapes and encourages shared defaults with targeted overrides. | | sweepit/no-optional-props-without-defaults | Disallows optional component props unless defaulted at the component boundary; type info improves optional-prop detection accuracy. | | sweepit/no-boolean-capability-props | Disallows boolean props without associated control handlers (for example open without onOpenChange) in component contracts. | | sweepit/no-external-binding-mutation | Enforces function-level mutation purity by disallowing mutation of outer bindings/parameters and requiring readonly typing for method calls on those bindings. | | sweepit/complexity | Enforces a maximum cyclomatic complexity threshold for functions and class initialization paths. | | sweepit/no-inline-call-expressions | Prefers extracting inline call expressions out of loop headers and call arguments into named variables. | | sweepit/max-custom-props | Limits custom prop count in *Props contracts (default max 8) to surface composition pressure early. | | sweepit/jsx-bem-compound-naming | Enforces block-prefixed naming for exported compound component parts. | | sweepit/jsx-compound-part-export-naming | Enforces Root/part alias export naming for compound component modules. | | sweepit/no-prop-drilling | Disallows props that are only forwarded unchanged to children. | | sweepit/jsx-flat-owner-tree | Encourages flatter parent component ownership trees by limiting deep handoff chains. |