Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 2.67 KB

File metadata and controls

41 lines (31 loc) · 2.67 KB

konsistent documentation

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."

Where to start

  • 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.

Guides

Reference

  • 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 must predicate (haveType, haveFiles, export, exportTypes, exportConstants, exportFunctions, exportInterfaces, exportClasses, import, importFrom, importTypes, import source predicates).
  • Constraintsmatches, segments for filtering placeholders.
  • Conditional rulesif, for, excludeFiles blocks inside must arrays.
  • Case mapskebabToPascalMap, kebabToCamelMap for acronyms and special casing.
  • Reusable conventionsconventionSources, string and use references, merge semantics, error reference.

Schema

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": []
}