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

@stateward/plugin-reducers

v1.2.2

Published

stateward rules for reducers: a reducer reaches every state it declares and can leave every state it enters.

Readme

@stateward/plugin-reducers

The reducers pack of stateward. It finds a reducer state no event reaches, and one the reducer never leaves.

Contents

Turn it on

npm install --save-dev stateward @stateward/plugin-reducers
// stateward.config.ts
import { defineConfig } from "stateward";
import { reducers } from "@stateward/plugin-reducers";

export default defineConfig({
  plugins: [reducers()],
  preset: "recommended", // or "strict"
});

npx stateward init writes this for you. A preset turns on the core and coverage rules; without one no rule is on.

One rule's severity (error, warning, info or off), and its options, go under rules:

rules: {
  "reducers/state-unreachable": "warning",
  // a severity and options; this option is at its default, the rule's page lists them all
  "reducers/state-cannot-leave": ["warning", { finalStates: [] }],
},

Every key of the config: config.md.

Rules

| Rule | What it finds | Why it matters | Kind | recommended | strict | | --- | --- | --- | --- | --- | --- | | state-cannot-leave | a reducer state that nothing leaves and that is not marked final | A reducer state with no way out keeps the user there for good, such as a failed payment with no retry; marking it final records that this is intended. | Core | warning | warning | | state-unreachable | a state of a reducer's union that no event can lead to | A reducer state that no event leads to is code that can never run, often a step that was planned and not written. | Core | error | error | | reducer-not-readable | a reducer, or a return in one, whose states cannot be read, so the reducer checks skip it | The reducer checks skip a place whose states cannot be read; a type that names its states brings it back under those checks. | Coverage | info | error |

Core rules are on in every preset. Coverage rules point at code whose types do not say enough for stateward to check it; they are info under recommended and errors under strict. Add-on rules stay off until you list their add-on in addons; the table shows their severity once it is listed. A rule marked (guess) judges from patterns in the code, not only from types, so it can be wrong and is never an error unless you make it one.

Each rule's page shows an example with what stateward prints for it, the fix, why it matters, what it misses, and its options. The pack's page: docs/packs/reducers.md. Every pack's rules: the rules index.