Skip to content

TypeScript rules

70 rules across 16 categories, enforced by chisel-js.

bundle · 1 rule

A client chunk containing application code exceeds the size budget

Fix. Split the route or import the heavy part dynamically. Vendor-only chunks are tolerated as a known cost; a chunk mixing application code is a regression. Requires a production build — run chisel-js bundle after building.

coherence · 2 rules

A test-runner include pattern matches no files

Fix. Fix the pattern or delete it. A glob matching nothing means part of the suite stopped running and CI stayed green — the one failure mode the test suite cannot report itself.

Maintained documentation cites a path that does not exist

Fix. Update the reference or remove it. Checked in root and docs/ markdown; generated API references and build output are excluded.

colour-enforcement · 4 rules

Arbitrary Tailwind colour value syntax (bg-[…], text-[#…], border-[…], etc.)

Fix. Add the colour as a CSS custom property in app.css first, then reference it as a Tailwind token (e.g. bg-primary).

Hardcoded Tailwind palette colour (text-red-500, bg-slate-800, from-blue-500)

Fix. Use a semantic token from app.css (bg-background, text-muted-foreground, text-destructive). A palette class pins one appearance and cannot follow the theme, so it looks wrong in whichever mode it was not written for.

Dynamic class construction (class={bg-${variable}})

Fix. Use a lookup object of pre-approved token names instead: const colourMap = { primary: ‘bg-primary’ }.

Experimental modifier class on semantic HTML

Fix. Modifier classes (.glass, .neumorphic) restricted to Hero components and Overlay widgets.

component-enforcement · 24 rules

Raw