{"_id":"@bobtail.software/eslint-plugin-b-durable","_rev":"5-9be1cf4922d959bace5ea026214834e8","name":"@bobtail.software/eslint-plugin-b-durable","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@bobtail.software/eslint-plugin-b-durable","version":"1.0.0","keywords":["eslint","eslintplugin","b-durable"],"author":{"url":"https://bobtail.software","name":"Victor Moreno","email":"info@bobtail.software"},"license":"GPL-3.0","_id":"@bobtail.software/eslint-plugin-b-durable@1.0.0","maintainers":[{"name":"bobtail.software","email":"victormor94+npm@gmail.com"}],"dist":{"shasum":"707e153a15054aa9f86639ff088817e8427e7fab","tarball":"https://registry.npmjs.org/@bobtail.software/eslint-plugin-b-durable/-/eslint-plugin-b-durable-1.0.0.tgz","fileCount":7,"integrity":"sha512-HDmt6QsBY0IgKq475/A0mxDWJtcsNbUEZ4JyuQofMVzLj0NgOa1upcgp5KotklLdegOtlvQoI21+wOYbIiZa5Q==","signatures":[{"sig":"MEUCIQDDKaxCH5YbhwA3l9tau9/UCYah2mNKvYyl0jfgCoIvMAIgaFV1+7fhhKx164zOWDY0BdOs8+C9c7SwvLR81GzvOMs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43784},"main":"index.js","_from":"file:bobtail.software-eslint-plugin-b-durable-1.0.0.tgz","exports":{".":"./index.js"},"_npmUser":{"name":"bobtail.software","email":"victormor94+npm@gmail.com"},"_resolved":"/tmp/047c7c947f544ccd72f0b4f9c8716180/bobtail.software-eslint-plugin-b-durable-1.0.0.tgz","_integrity":"sha512-HDmt6QsBY0IgKq475/A0mxDWJtcsNbUEZ4JyuQofMVzLj0NgOa1upcgp5KotklLdegOtlvQoI21+wOYbIiZa5Q==","_npmVersion":"10.9.2","description":"ESLint rules for b-durable workflows","directories":{},"_nodeVersion":"23.11.1","dependencies":{"eslint-plugin-utils":"^0.4.1"},"_hasShrinkwrap":false,"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-b-durable_1.0.0_1762639530563_0.3045899774728218","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bobtail.software/eslint-plugin-b-durable","version":"1.0.1","keywords":["eslint","eslintplugin","b-durable"],"author":{"url":"https://bobtail.software","name":"Victor Moreno","email":"info@bobtail.software"},"license":"GPL-3.0","_id":"@bobtail.software/eslint-plugin-b-durable@1.0.1","maintainers":[{"name":"bobtail.software","email":"victormor94+npm@gmail.com"}],"dist":{"shasum":"1e1a354e3912213689ffa97ea7c5614620d4bc3c","tarball":"https://registry.npmjs.org/@bobtail.software/eslint-plugin-b-durable/-/eslint-plugin-b-durable-1.0.1.tgz","fileCount":7,"integrity":"sha512-Cng1IjAyMoxg5GuI1RD6DD+LdUFFgpw2kwy0kW41Eq0+LZ2vyWC+pDT2nYENN4axUT2AWra9CIsZP9HzBvdlwQ==","signatures":[{"sig":"MEYCIQDMQIY/tqrJBgo95biXAAe9ZT4Ww+Qti4mCP86toRW3YQIhAKlnSfnxgfrhOoN8C75AKb4cqsJ/xPVeL9TDeQv/6cFn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43791},"main":"index.js","_from":"file:bobtail.software-eslint-plugin-b-durable-1.0.1.tgz","exports":{".":"./index.js"},"_npmUser":{"name":"bobtail.software","email":"victormor94+npm@gmail.com"},"_resolved":"/tmp/077ca50963359ff21ffc482916b443e6/bobtail.software-eslint-plugin-b-durable-1.0.1.tgz","_integrity":"sha512-Cng1IjAyMoxg5GuI1RD6DD+LdUFFgpw2kwy0kW41Eq0+LZ2vyWC+pDT2nYENN4axUT2AWra9CIsZP9HzBvdlwQ==","_npmVersion":"10.9.2","description":"ESLint rules for b-durable workflows","directories":{},"_nodeVersion":"23.11.1","dependencies":{"eslint-plugin-utils":"^0.4.1"},"_hasShrinkwrap":false,"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-b-durable_1.0.1_1762641994659_0.3202228190153047","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@bobtail.software/eslint-plugin-b-durable","version":"1.0.3","keywords":["eslint","eslintplugin","b-durable"],"author":{"url":"https://bobtail.software","name":"Victor Moreno","email":"info@bobtail.software"},"license":"GPL-3.0","_id":"@bobtail.software/eslint-plugin-b-durable@1.0.3","maintainers":[{"name":"bobtail.software","email":"victormor94+npm@gmail.com"}],"dist":{"shasum":"7c6cd9485e75d836f9c28e0374101d481bf70c1a","tarball":"https://registry.npmjs.org/@bobtail.software/eslint-plugin-b-durable/-/eslint-plugin-b-durable-1.0.3.tgz","fileCount":7,"integrity":"sha512-OQOd3FpUue0+qU4cJ/8OybSyQMUdcyc4cbTagInLeTwLvq9EqLylPqCHqoqvcpT92KN0HWNh8Ng6woxtT3vr2A==","signatures":[{"sig":"MEUCICqdq+gHdZ/YybQc66EkwH4jw+hyleMSSSPM2jegrj0UAiEA+vf4XotqyAgvjkJ5A+p7DR9l4VMke0SuDNhGw2SzH9U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44188},"main":"index.js","type":"module","_from":"file:bobtail.software-eslint-plugin-b-durable-1.0.3.tgz","exports":{".":"./index.js"},"_npmUser":{"name":"bobtail.software","email":"victormor94+npm@gmail.com"},"_resolved":"/tmp/209afb8bf3569a9f19f1f22671ff799f/bobtail.software-eslint-plugin-b-durable-1.0.3.tgz","_integrity":"sha512-OQOd3FpUue0+qU4cJ/8OybSyQMUdcyc4cbTagInLeTwLvq9EqLylPqCHqoqvcpT92KN0HWNh8Ng6woxtT3vr2A==","_npmVersion":"10.9.2","description":"ESLint rules for b-durable workflows","directories":{},"_nodeVersion":"23.11.1","_hasShrinkwrap":false,"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-b-durable_1.0.3_1762652765966_0.07766065636274111","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@bobtail.software/eslint-plugin-b-durable","version":"1.0.4","keywords":["eslint","eslintplugin","b-durable"],"author":{"url":"https://bobtail.software","name":"Victor Moreno","email":"info@bobtail.software"},"license":"GPL-3.0","_id":"@bobtail.software/eslint-plugin-b-durable@1.0.4","maintainers":[{"name":"bobtail.software","email":"victormor94+npm@gmail.com"}],"dist":{"shasum":"b40b3c52c90c4ae042c95dca7ea0b1fb699ef03c","tarball":"https://registry.npmjs.org/@bobtail.software/eslint-plugin-b-durable/-/eslint-plugin-b-durable-1.0.4.tgz","fileCount":7,"integrity":"sha512-sC/oRDKDLRCMkBpdA7STOdAXY1/XjM0dUFEPHmI1cDlYtcrUclxgpxoemLcU3diU/ldzlTOSglB1qC+FNdapIg==","signatures":[{"sig":"MEQCIF+FLEv6Y+mp+11DA9AMLnxs/Z3EgFIQ6qbIquMVDiy9AiAe2L6uKQPNSkmU18p7hCHaOMSOiB2SW2Ey7M55nt3e/g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47398},"main":"index.js","type":"module","_from":"file:bobtail.software-eslint-plugin-b-durable-1.0.4.tgz","exports":{".":"./index.js"},"_npmUser":{"name":"bobtail.software","email":"victormor94+npm@gmail.com"},"_resolved":"/tmp/c8e9282722bb5e1edf4d4610b3128a2a/bobtail.software-eslint-plugin-b-durable-1.0.4.tgz","_integrity":"sha512-sC/oRDKDLRCMkBpdA7STOdAXY1/XjM0dUFEPHmI1cDlYtcrUclxgpxoemLcU3diU/ldzlTOSglB1qC+FNdapIg==","_npmVersion":"10.9.2","description":"ESLint rules for b-durable workflows","directories":{},"_nodeVersion":"23.11.1","_hasShrinkwrap":false,"peerDependencies":{"eslint":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-b-durable_1.0.4_1762799293184_0.7496795804047811","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@bobtail.software/eslint-plugin-b-durable","version":"1.0.5","description":"ESLint rules for b-durable workflows","main":"index.js","type":"module","exports":{".":"./index.js"},"keywords":["eslint","eslintplugin","b-durable"],"author":{"name":"Victor Moreno","email":"info@bobtail.software","url":"https://bobtail.software"},"license":"GPL-3.0","peerDependencies":{"eslint":">=8.0.0"},"_id":"@bobtail.software/eslint-plugin-b-durable@1.0.5","_integrity":"sha512-Edzdhs62CKbPNS8GNgqF/Lk9C/rsx+yVMCoTSjYPFONVzrCNc5E8DRo+QJjQaPQuxI68ZqiMReLAJ9cQGnnH6A==","_resolved":"/tmp/7a3449da0b9fc2c1c708ae8e78df78fa/bobtail.software-eslint-plugin-b-durable-1.0.5.tgz","_from":"file:bobtail.software-eslint-plugin-b-durable-1.0.5.tgz","_nodeVersion":"23.11.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Edzdhs62CKbPNS8GNgqF/Lk9C/rsx+yVMCoTSjYPFONVzrCNc5E8DRo+QJjQaPQuxI68ZqiMReLAJ9cQGnnH6A==","shasum":"5cd749f3491ae263e1df9bf05580c67c897ada3a","tarball":"https://registry.npmjs.org/@bobtail.software/eslint-plugin-b-durable/-/eslint-plugin-b-durable-1.0.5.tgz","fileCount":8,"unpackedSize":49629,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC2OgIcOjxvP3hQvist67UfsacqfskVtAxV2hnDpKqUewIhAI/DjZ+kM3ebqTcd2/2pJO9usdNm4uN3ujtTgYNnBlwN"}]},"_npmUser":{"name":"bobtail.software","email":"victormor94+npm@gmail.com"},"directories":{},"maintainers":[{"name":"bobtail.software","email":"victormor94+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-plugin-b-durable_1.0.5_1763753110123_0.5421831223753937"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-08T22:05:30.441Z","modified":"2025-11-21T19:25:10.528Z","1.0.0":"2025-11-08T22:05:30.759Z","1.0.1":"2025-11-08T22:46:34.861Z","1.0.3":"2025-11-09T01:46:06.179Z","1.0.4":"2025-11-10T18:28:13.406Z","1.0.5":"2025-11-21T19:25:10.344Z"},"author":{"name":"Victor Moreno","email":"info@bobtail.software","url":"https://bobtail.software"},"license":"GPL-3.0","keywords":["eslint","eslintplugin","b-durable"],"description":"ESLint rules for b-durable workflows","maintainers":[{"name":"bobtail.software","email":"victormor94+npm@gmail.com"}],"readme":"\n# eslint-plugin-b-durable\n\n![NPM Version](https://img.shields.io/npm/v/@bobtail.software/eslint-plugin-b-durable.svg)\n![License](https://img.shields.io/npm/l/@bobtail.software/eslint-plugin-b-durable.svg)\n\nThis plugin provides ESLint rules for the [`b-durable`](https://github.com/bobtail-software/b-durable) library.\n\nThe `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.\n\nThis plugin helps you avoid common pitfalls by:\n1.  Flagging unsupported language constructs—such as loops (`for`, `while`) and nested `try/catch` blocks—**only inside your workflow files**.\n2.  Enforcing architectural boundaries: preventing your application code from importing workflow sources, and preventing workflow sources from importing compiled artifacts.\n\n## Installation\n\nFirst, install ESLint, the TypeScript parser, and this plugin in your project:\n\n```bash\n# Using npm\nnpm install --save-dev eslint typescript-eslint @bobtail.software/eslint-plugin-b-durable\n\n# Using yarn\nyarn add --dev eslint typescript-eslint @bobtail.software/eslint-plugin-b-durable\n\n# Using pnpm\npnpm add -D eslint typescript-eslint @bobtail.software/eslint-plugin-b-durable\n```\n\n## Usage\n\nThe plugin supports both modern \"flat\" config and legacy `.eslintrc` formats.\n\n### Flat Config ( `eslint.config.js` ) - Recommended\n\nThis is ESLint's modern configuration format. In your `eslint.config.js`, spread the `recommended` configuration into your config array.\n\n```javascript\n// eslint.config.js\nimport js from '@eslint/js';\nimport tseslint from 'typescript-eslint';\nimport bDurablePlugin from '@bobtail.software/eslint-plugin-b-durable';\n\nexport default tseslint.config(\n  // Base configurations\n  js.configs.recommended,\n  ...tseslint.configs.recommended,\n\n  // Simply spread the b-durable recommended config.\n  // The `...` is important!\n  ...bDurablePlugin.configs.recommended\n);\n```\n\n---\n\n### Legacy Config ( `.eslintrc.js` )\n\nIf you are still using the traditional `.eslintrc.js` or `.eslintrc.json` file, extend the `recommended-legacy` configuration.\n\n```javascript\n// .eslintrc.js\nmodule.exports = {\n  root: true,\n  parser: '@typescript-eslint/parser',\n  plugins: [\n    '@typescript-eslint',\n    '@bobtail.software/b-durable',\n  ],\n  extends: [\n    'eslint:recommended',\n    'plugin:@typescript-eslint/recommended',\n\n    // Note: use the 'recommended-legacy' config for .eslintrc files\n    'plugin:@bobtail.software/b-durable/recommended-legacy',\n  ],\n};\n```\n\n## ✨ Automatic Scoping\n\nThe plugin intelligently applies rules where they make sense:\n\n-   **Workflow-only rules** (like `no-unsupported-constructs`) are applied *only* to files ending in `.workflow.ts`, `.workflow.mts`, or `.workflow.cts`.\n-   **Project-wide rules** (like `no-direct-workflow-import`) are applied globally to enforce correct architectural boundaries.\n\n## Supported Rules\n\nThe following rules are included and enabled by default in the recommended configurations.\n\n| Rule                                                              | Description                                                                                                                                                             | Scope         |\n| :---------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |\n| `@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 |\n| `@bobtail.software/b-durable/no-nested-try`               | Disallows nesting `try/catch` statements inside a `bDurable` workflow.                                                                                                  | Workflow Only |\n| `@bobtail.software/b-durable/no-direct-workflow-import`   | Enforces clean architectural boundaries for workflow imports. | Global        |\n\n### Example: `no-direct-workflow-import`\n\nThis rule enforces two critical architectural principles:\n\n**1. Application code must use compiled workflows.**\n```typescript\n// ❌ Incorrect: An API file should not import the source workflow.\n// In: src/api/start-process.ts\nimport { userOnboardingWorkflow } from '../workflows/onboarding.workflow'; // <-- ESLint error\n\n// ✅ Correct: The API file should import the compiled workflow from the generated index.\n// In: src/api/start-process.ts\nimport { userOnboardingWorkflow } from '../generated';\n```\n\n**2. Workflow source code must not depend on compiled artifacts.**\n```typescript\n// ✅ Correct: A workflow can import another source workflow for composition.\n// In: src/workflows/main-orchestrator.workflow.ts\nimport { userOnboardingWorkflow } from './onboarding.workflow'; // <-- OK\n\n// ❌ Incorrect: A source workflow cannot import a compiled workflow.\n// In: src/workflows/main-orchestrator.workflow.ts\nimport { userOnboardingWorkflow } from '../generated/onboarding.workflow.compiled.mts'; // <-- ESLint error\n```\n\n## Contributing\n\nContributions are welcome! If you have ideas for new rules or improvements, please open an issue or a pull request.\n\n## License\n\nThis project is licensed under the GPL-3.0 License. See the [LICENSE](LICENSE) file for details.","readmeFilename":"README.md"}