Installation
Add a first policy to a TypeScript repository and watch it catch a bad import.
-
Install the oxlint plugin and the CLI:
Terminal window pnpm add -D @goodbones/oxlint # editor and CI feedback through oxlintpnpm add -D @goodbones/cli # the `architecture` command -
Enable the plugin’s rules in
.oxlintrc.json:{"jsPlugins": [{ "name": "architecture", "specifier": "@goodbones/oxlint" }],"rules": {"architecture/imports": "error","architecture/exports": "error","architecture/members": "error","architecture/structure": "error","architecture/surface": "error"}}The plugin also has an
architecture/campaignsrule; see Campaigns installation. -
Write
architecture.yamlat the repository root:# yaml-language-server: $schema=https://dataquail.github.io/goodbones/schema/architecture.schema.jsonresolve:scopes:- files: ""language: typescriptoptions: { tsconfig: tsconfig.json }unresolved: erroraliases:"@": srctree:"@/domain/":imports:message: "domain/ may not reach the framework."reset: trueexternal: [effect]allow: ["@/domain/**"]children:"*.ts": {}This says:
src/domain/admits only.tsfiles.- Files there may import only from
src/domain/andeffect. Anything else fails with the message. - Every import in the repository must resolve to a file.
Or run
pnpm exec architecture initfor a starter, or infer one from your code. -
Plant a violation and watch it fail:
Terminal window echo 'import "express";' > src/domain/probe.tspnpm oxlint srcrm src/domain/probe.ts -
Run the CLI to check the whole repository, including the
graphrules the plugin cannot see:Terminal window pnpm exec architecture check
Errors at load
Section titled “Errors at load”The plugin reads the manifest when oxlint starts. A malformed manifest stops the lint with every error at once, each naming its file, line and column. A rule that can no longer match anything also stops it; see probes.
Editor completion
Section titled “Editor completion”The first-line comment points your YAML extension (such as VS Code’s) at the manifest’s schema, so it completes keys and flags misspellings as you type.