konsistent is a CLI linter that checks whether files and directories in your TypeScript codebase match declared structural patterns. It fills a gap that ESLint, Biome, and oxlint don't cover: they enforce code style and best practices within files, but none of them verify project-level structural conventions — like "every provider package must export the same shape" or "every adapter must extend the base class."
- New here? Getting started — install, write your first config, run the CLI.
- Inheriting a codebase? Exploring codebases — how to identify patterns worth enforcing before writing rules.
- Have violations? Fixing violations — workflow for triaging and resolving them.
- Getting started
- Examples — common patterns library.
- Exploring codebases — what to look for before writing rules.
- Fixing violations — triage workflow.
- CI integration — GitHub Actions, output formats, PR comments.
- Authoring reusable conventions — publish a convention package others can consume.
- CLI — commands, flags, output formats, exit codes.
- konsistent.json configuration — top-level schema and convention shape.
- Path patterns — globs, placeholders, case transformations, negation.
- Predicates — every
mustpredicate (haveType,haveFiles,export,exportTypes,exportConstants,exportFunctions,exportInterfaces,exportClasses,import,importFrom,importTypes, import source predicates). - Constraints —
matches,segmentsfor filtering placeholders. - Conditional rules —
if,for,excludeFilesblocks insidemustarrays. - Case maps —
kebabToPascalMap,kebabToCamelMapfor acronyms and special casing. - Reusable conventions —
conventionSources, string andusereferences, merge semantics, error reference.
The full machine-readable schema lives in the published package at node_modules/konsistent/konsistent.schema.json. Reference it from your konsistent.json for editor autocomplete:
{
"$schema": "node_modules/konsistent/konsistent.schema.json",
"version": "v1",
"conventions": []
}