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

@bobtail.software/eslint-plugin-b-durable

v1.0.5

Published

ESLint rules for b-durable workflows

Readme

eslint-plugin-b-durable

NPM Version License

This plugin provides ESLint rules for the b-durable library.

The b-durable compiler transforms your async functions into a deterministic state machine. This process imposes certain restrictions on the code constructs that can be used inside a workflow.

This plugin helps you avoid common pitfalls by:

  1. Flagging unsupported language constructs—such as loops (for, while) and nested try/catch blocks—only inside your workflow files.
  2. Enforcing architectural boundaries: preventing your application code from importing workflow sources, and preventing workflow sources from importing compiled artifacts.

Installation

First, install ESLint, the TypeScript parser, and this plugin in your project:

# Using npm
npm install --save-dev eslint typescript-eslint @bobtail.software/eslint-plugin-b-durable

# Using yarn
yarn add --dev eslint typescript-eslint @bobtail.software/eslint-plugin-b-durable

# Using pnpm
pnpm add -D eslint typescript-eslint @bobtail.software/eslint-plugin-b-durable

Usage

The plugin supports both modern "flat" config and legacy .eslintrc formats.

Flat Config ( eslint.config.js ) - Recommended

This is ESLint's modern configuration format. In your eslint.config.js, spread the recommended configuration into your config array.

// eslint.config.js
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import bDurablePlugin from '@bobtail.software/eslint-plugin-b-durable';

export default tseslint.config(
  // Base configurations
  js.configs.recommended,
  ...tseslint.configs.recommended,

  // Simply spread the b-durable recommended config.
  // The `...` is important!
  ...bDurablePlugin.configs.recommended
);

Legacy Config ( .eslintrc.js )

If you are still using the traditional .eslintrc.js or .eslintrc.json file, extend the recommended-legacy configuration.

// .eslintrc.js
module.exports = {
  root: true,
  parser: '@typescript-eslint/parser',
  plugins: [
    '@typescript-eslint',
    '@bobtail.software/b-durable',
  ],
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',

    // Note: use the 'recommended-legacy' config for .eslintrc files
    'plugin:@bobtail.software/b-durable/recommended-legacy',
  ],
};

✨ Automatic Scoping

The plugin intelligently applies rules where they make sense:

  • Workflow-only rules (like no-unsupported-constructs) are applied only to files ending in .workflow.ts, .workflow.mts, or .workflow.cts.
  • Project-wide rules (like no-direct-workflow-import) are applied globally to enforce correct architectural boundaries.

Supported Rules

The following rules are included and enabled by default in the recommended configurations.

| Rule | Description | Scope | | :---------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | | @bobtail.software/b-durable/no-unsupported-constructs | Disallows the use of loops (for, while, do-while) and switch statements inside a bDurable workflow. | Workflow Only | | @bobtail.software/b-durable/no-nested-try | Disallows nesting try/catch statements inside a bDurable workflow. | Workflow Only | | @bobtail.software/b-durable/no-direct-workflow-import | Enforces clean architectural boundaries for workflow imports. | Global |

Example: no-direct-workflow-import

This rule enforces two critical architectural principles:

1. Application code must use compiled workflows.

// ❌ Incorrect: An API file should not import the source workflow.
// In: src/api/start-process.ts
import { userOnboardingWorkflow } from '../workflows/onboarding.workflow'; // <-- ESLint error

// ✅ Correct: The API file should import the compiled workflow from the generated index.
// In: src/api/start-process.ts
import { userOnboardingWorkflow } from '../generated';

2. Workflow source code must not depend on compiled artifacts.

// ✅ Correct: A workflow can import another source workflow for composition.
// In: src/workflows/main-orchestrator.workflow.ts
import { userOnboardingWorkflow } from './onboarding.workflow'; // <-- OK

// ❌ Incorrect: A source workflow cannot import a compiled workflow.
// In: src/workflows/main-orchestrator.workflow.ts
import { userOnboardingWorkflow } from '../generated/onboarding.workflow.compiled.mts'; // <-- ESLint error

Contributing

Contributions are welcome! If you have ideas for new rules or improvements, please open an issue or a pull request.

License

This project is licensed under the GPL-3.0 License. See the LICENSE file for details.