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

@triggery/eslint-plugin

v0.10.0

Published

ESLint plugin for Triggery — catches mis-use of createTrigger / useEvent / useCondition / useAction, suggests named hooks, enforces handler size budgets.

Readme

@triggery/eslint-plugin

ESLint plugin for Triggery: catches mis-use of createTrigger and the hook-API, enforces conventions, and keeps trigger files readable as specs.

pnpm add -D @triggery/eslint-plugin

Rules

| Rule | Recommended | Strict | Auto-fix | |---------------------------|:-----------:|:-------------:|:--------:| | no-dynamic-id | error | error | — | | no-event-cascade | error | error | — | | hook-rules | error | error | — | | exhaustive-conditions | warn | error | — | | exhaustive-required | warn | error | — | | max-handler-size | warn (≤50) | error (≤30) | — | | max-ports-per-trigger | warn (≤12) | error (≤8) | — | | prefer-named-hook | off | warn (≥3) | — |

Flat config (ESLint 9.x)

// eslint.config.js
import triggery from '@triggery/eslint-plugin';

export default [
  triggery.configs.recommended,
  // Or, if you want everything dialled up:
  // triggery.configs.strict,
];

Cherry-picking individual rules

import triggery from '@triggery/eslint-plugin';

export default [
  {
    plugins: { '@triggery': triggery },
    rules: {
      '@triggery/no-dynamic-id': 'error',
      '@triggery/no-event-cascade': 'error',
      '@triggery/max-handler-size': ['warn', { max: 40 }],
    },
  },
];

Per-rule

no-dynamic-id

createTrigger({ id }) must be a string literal. Trigger ids are runtime registry keys, devtools action labels and graph-output anchors — they must be deterministic.

no-event-cascade

Disallows calling useEvent(...) inside a useAction(...) handler. Cascades are allowed at runtime (up to maxCascadeDepth), but writing them inline hides cross-trigger control flow.

hook-rules

Framework-neutral rules-of-hooks: useEvent / useCondition / useAction / useInlineTrigger must be called from a component (function whose name starts with an uppercase letter) or a custom hook (function whose name starts with use[A-Z]).

exhaustive-conditions

If a trigger declares required: ['user','settings'], the same file must contain at least one useCondition(<trigger>, 'user', ...) and one useCondition(<trigger>, 'settings', ...). Cross-file checks are intentionally out of scope to keep the rule fast and predictable.

exhaustive-required

Every createTrigger({...}) call must include an explicit required: key (use required: [] if no conditions are required). Catches the common mistake of "I forgot the gate, the handler will run on every fire even when the world isn't ready".

max-handler-size (configurable, default 50)

'@triggery/max-handler-size': ['warn', { max: 50 }]

Counts top-level statements in the handler body. If you hit the limit, consider the extract-trigger codemod from @triggery/codemod.

max-ports-per-trigger (configurable)

'@triggery/max-ports-per-trigger': ['warn', { maxEvents: 8, maxConditions: 8, maxTotal: 12 }]

Caps the per-trigger port count to keep scenarios spec-like.

prefer-named-hook (configurable, off by default)

'@triggery/prefer-named-hook': ['warn', { threshold: 4 }]

Once a file has threshold or more port calls, suggests switching from useEvent(trigger, 'new-message') to the named hook useNewMessageEvent (available via trigger.namedHooks()).

Documentation

Full documentation, recipes and API reference at https://triggeryjs.github.io/packages/eslint-plugin/.

Related packages

  • @triggery/codemod — Codemods that introduce trigger files this plugin then checks.
  • @triggery/clitriggery lint ships this plugin's recommended preset by default.

See the full package list in the repo README.

License

MIT © Aleksey Skhomenko