Skip to content

Check a SvelteKit frontend

You have a SvelteKit frontend and want chisel-js to find architecture violations in it. This guide installs the TypeScript CLI, runs a check, and explains how to read the output.

Terminal window
npm install -g chisel-js # or: bun add -g chisel-js
chisel-js --version

Requires Node 20+. Runtime deps (chalk, commander, estree-walker, fast-glob, svelte, typescript) install automatically — TypeScript is used to parse and resolve your imports, so it ships with the CLI.

Run init once. It works out which topology your project has and writes chisel.config.json:

Terminal window
chisel-js init ./your-frontend
Mode What it means
sveltekit-standalone SvelteKit owns its data layer — Drizzle under $lib/server, no separate backend
sveltekit-bff SvelteKit fronts a separate API through a generated openapi-fetch client

The mode decides which rules apply: a standalone app has repositories and remote functions, a BFF has a generated API client. Detection runs only here — from then on check reads the file, so the rule set can’t change because someone edited a dependency. Override with --mode sveltekit-bff if the guess is wrong.

check still works without a config; it detects a mode, says so, and suggests running init.

Point chisel-js check at your project root. Default path is ..

Terminal window
chisel-js check ./your-frontend

Non-zero exit on any ERROR-level violation. That’s what makes it safe to gate commits and CI on.

Coloured, grouped by category, one block per violation. Each violation names the file, line, rule ID, and a short message.

Terminal window
chisel-js check ./your-frontend

For scripts, agents, or CI, ask for JSON; see Understand a violation for how to read the deduplicated --json output.