
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
eslint-plugin-machina
Advanced tools
ESLint plugin for static analysis of machina FSM configs. Catches structural issues at lint time — unreachable states, infinite _onEnter loops, missing handlers — without running the machine.
Built on machina-inspect. ESLint 9 flat config only.
npm install --save-dev eslint-plugin-machina
# or
pnpm add -D eslint-plugin-machina
machina-inspect is pulled in automatically as a dependency. For TypeScript files, you also need @typescript-eslint/parser:
npm install --save-dev @typescript-eslint/parser
// eslint.config.mjs
import machina from "eslint-plugin-machina";
export default [
machina.configs.recommended,
// ... your other configs
];
// eslint.config.mjs
import tsParser from "@typescript-eslint/parser";
import machina from "eslint-plugin-machina";
export default [
{
files: ["src/**/*.ts"],
languageOptions: { parser: tsParser },
},
machina.configs.recommended,
];
// eslint.config.mjs
import machina from "eslint-plugin-machina";
export default [
{
plugins: { machina },
rules: {
"machina/unreachable-state": "warn",
"machina/onenter-loop": "error",
"machina/missing-handler": "off",
},
},
];
| Rule | Default | Type | Description |
|---|---|---|---|
machina/unreachable-state | "warn" | problem | States with no inbound path from initialState |
machina/onenter-loop | "error" | problem | Unconditional _onEnter transition cycles |
machina/missing-handler | "off" | suggestion | States missing handlers for inputs other states handle |
machina/unreachable-stateDetects states with no inbound path from initialState. Unreachable states are dead code.
// Triggers warning on "broken"
createFsm({
id: "traffic-light",
initialState: "green",
states: {
green: { timeout: "yellow" },
yellow: { timeout: "red" },
red: { timeout: "green" },
broken: {}, // no transitions lead here
},
});
machina/onenter-loopDetects unconditional _onEnter transition cycles that will infinite-loop the runtime. Only flags cycles where every edge is unconditional — conditional bounces like if (ctx.error) return "failed" are intentional patterns, not bugs.
// Triggers error — unconditional cycle: a -> b -> a
createFsm({
id: "bouncy",
initialState: "a",
states: {
a: { _onEnter: () => "b" },
b: { _onEnter: () => "a" },
},
});
machina/missing-handlerDetects states that don't handle inputs handled by other states in the same FSM. Off by default — many FSMs have asymmetric handlers by design (terminal states, initialization states, etc.). States with a * catch-all handler are excluded.
// Triggers suggestion — "idle" doesn't handle "stop" or "pause"
createFsm({
id: "player",
initialState: "idle",
states: {
idle: { start: "running" },
running: { stop: "idle", pause: "paused" },
paused: { resume: "running", stop: "idle" },
},
});
The plugin listens for createFsm() and createBehavioralFsm() call expressions, builds a StateGraph from the AST using machina-inspect's graph IR, then runs the same structural checks machina-inspect provides. Findings are reported as ESLint diagnostics at the call site.
_child resolutionChild FSM references on _child are resolved when they're:
_child: createFsm({ ... }) directly in the state configconst references: _child: myChildFsm where myChildFsm is a const declaration bound to a createFsm() / createBehavioralFsm() call in the same moduleCross-module imports and let/var bindings are silently skipped — no false positives, just no analysis for those cases.
MIT
FAQs
ESLint plugin for static analysis of machina FSM configs.
The npm package eslint-plugin-machina receives a total of 11 weekly downloads. As such, eslint-plugin-machina popularity was classified as not popular.
We found that eslint-plugin-machina demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.