@ivy-apps/deslop
v0.13.0
Published
Static import-graph analyzer for TypeScript. Architecture rules in YAML, enforced on every run.
Maintainers
Readme
Deslop
Static import-graph analyzer for TypeScript. You write architecture rules in YAML; Deslop checks them on every run.
You define your architecture once — what modules may import, what they must import, and what companion files must exist (unit tests, Storybook stories). When a rule breaks, Deslop reports exactly what broke and how to fix it, in plain language that both your team and your AI agents can act on.
No AI and no heuristics: it walks the import graph, so the same code always produces the same result.
Deslop is complementary to ESLint and Biome. Where it does replace something is architecture enforcement — the import-boundary rules and companion-file checks you'd otherwise spread across Dependency Cruiser configs and hand-written ESLint plugins.
Install
npm install --save-dev @ivy-apps/deslopOr run it without installing:
npx @ivy-apps/deslop check .Usage
Write your rulebooks as YAML files in deslop/rules/, then run:
| Command | What it does |
|---------|--------------|
| deslop check <project> | Report all rule violations |
| deslop fix <project> | Auto-fix violations where possible |
| deslop baseline <project> | Write deslop/baseline.yaml to silence current violations |
| deslop explore <project> | Write an interactive module graph to deslop/diagram/index.html, and open it (--ci never opens it) |
Recommended package.json scripts:
{
"scripts": {
"deslop": "deslop check .",
"deslop:fix": "deslop fix . && npm run lint:fix",
"deslop:baseline": "deslop baseline ."
}
}A rule looks like this
id: feature-sliced
name: Feature-Sliced Architecture
rules:
- id: feature-isolation
description: Features must not import from other features.
target: "@/features/**"
forbids:
- import: "@/features/**"
allows:
- import: "{{TARGET_DIR}}/**" # own feature is always fine
fix: >-
Promote shared logic to @/components, @/hooks, @/lib
or an appropriate shared folder.Rules can forbid imports (directly or transitively), whitelist exceptions, require imports, and require companion files such as tests or Storybook stories. Patterns support casing variables like {{FileName}} and {{TARGET_DIR}} so a single rule stays relative and reusable.
Requirements
- Node.js >= 18
- Prebuilt binaries for
darwin-arm64,linux-x64,linux-arm64, andwin32-x64. - A
@/path alias configured intsconfig.json, so Deslop can resolve your modules
Deslop is free and open source. No license key, no account required — in CI or anywhere else.
Documentation
- deslop.dev — overview and examples
- Writing rules — the full rule reference
- Example rulebooks — Clean Architecture, Feature-Sliced, MVI, Next.js App Router, and more
- Glob+ reference — full pattern-matching semantics
- Issue tracker
License
MIT © Ivy Apps Ltd
