klint.yaml
Every option, generated live from klint.schema.json. Refreshed hourly.
root
stringRoot directory used to resolve include paths and report relative file names. Defaults to the directory containing klint.config.json.
include
string[]Glob patterns selecting which TypeScript files to lint. Prefix with ! to exclude. Defaults to ["."] which lints all .ts files under root. Example: ["src", "klint", "!**/node_modules/**"]
plugins
"sonar"[]Named rule bundles to enable. Each plugin applies a default set of rules at "error" severity. Individual rules from the bundle can be overridden or silenced via the rules map. Available: "sonar".
rules
Record<string, "error" | "warn" | "off" | object>Map of rule name → severity or options. Example: { "no-floating-promise": "error", "no-sync-in-async": { "severity": "warn", "include": ["src/hooks/**"] } }.
Every rule takes either a severity string or an options object. The first rule below is fully expanded as a reference; all rules follow the same shape.
no-unguarded-json-parse
"error" | "warn" | "off" | objectFlags JSON.parse() calls that aren't wrapped in try/catch — malformed input crashes the process.
errorwarnoffno-unguarded-json-parse: error
severity
"error" | "warn" | "off"Rule severity. "error" exits with code 2; "warn" reports but exits 0; "off" silences.
errorwarnoffinclude
string[]Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: ["src/hooks/**", "!src/hooks/scripts/**"]
- no-sync-in-async
- Flags synchronous I/O (
readFileSync,execSync, etc.) inside async functions — blocks the event loop when an async equivalent is available. - no-floating-promise
- Flags Promise-returning expressions that aren't awaited or
.catch()-handled — silent failures and unpredictable execution order. - no-misused-promises
- Flags Promises passed where the type expects a non-thenable (e.g. an
ifcondition, avoidcallback). The Promise's truthiness — not its resolved value — drives the branch. - no-async-predicate
- Flags
asyncfunctions passed to.filter/.some/.every/.find/.findIndex. Array methods coerce the returned promise to truthy, so every element appears to match. - no-date-equality
- Flags
Datecomparisons with==/===/!=/!==— these compare object identity, not the time value. Use.getTime()instead. - no-optional-chain-on-non-nullable
- Flags
?.on receivers whose static type cannot benullorundefined. The optional chain is dead code and obscures the real shape. - no-object-in-template
- Flags non-primitive objects interpolated into template literals — produces
[object Object]unlesstoString()is overridden. - no-nested-template-literals
- Flags template literals nested inside template literals — almost always unreadable; extract to a variable.
- no-consecutive-array-push
- Flags consecutive
arr.push(x); arr.push(y);calls — combine intoarr.push(x, y)orarr.push(...items). - no-string-match
- Flags
String#match— prefer.matchAll()for iteration or.test()for boolean checks..match()returns different shapes depending on the/gflag. - sonar/prefer-string-replaceall
- Flags
.replace(/x/g, y)on strings —.replaceAll('x', y)is clearer and faster for all-occurrence replacements. - sonar/prefer-string-raw-regexp
- Flags regex literals built from escape-heavy string concatenation —
String.rawdrops the double backslashes. - sonar/prefer-string-raw
- Flags string literals with multiple backslash escapes —
String.rawis more readable (Windows paths, regex source, etc.). - sonar/prefer-nullish-coalescing-assign
- Flags
x = x ?? ypatterns —x ??= yis the dedicated nullish assignment operator. - sonar/no-single-char-class
- Flags single-character character classes in regex (e.g.
/[a]/) — drop the brackets; the regex matches the same. - sonar/prefer-at
- Flags negative-index access via
arr[arr.length - 1]—.at(-1)reads cleaner for last-element access.
arch
objectArchitecture-as-Code constraints — layers, import boundaries, forbidden patterns, singleton locations. Enforced by the arch engine alongside the rule set.
layers
Record<string, string[]>Named architectural zones. Keys are arbitrary layer names; values are glob patterns matching the files in that layer. Other arch rules reference these names instead of repeating globs.
layers: core: ["src/hooks/lib/**", "src/tools/**"] skills: ["assets/skills/**"] dao: ["src/dao/**"]
imports
object[]Import-boundary rules. The dependency graph your README claims you have.
from
string | string[]Source — a layer name or glob(s) for the files this rule applies to. Imports originating in from are checked against deny/allow.
deny
string | string[]Layer name(s) or glob(s) the source is not allowed to import from. Mutually exclusive in spirit with allow (use one or the other).
allow
string | string[]Allowlist of layer name(s) / glob(s) the source may import from. Anything not matching allow is denied.
type-only
stringWhen set to "allow", import type statements that would otherwise be denied are permitted. Useful for type-only references across layers.
message
stringCustom error message reported when the rule is violated. Shown in the agent's event stream alongside file:line.
severity
"error" | "warn"Severity for the arch rule. "error" exits with code 2; "warn" reports but exits 0. (arch rules cannot be "off" — remove the entry instead.)
errorwarnforbidden
object | object[]Forbidden-pattern rules. Block literal strings scoped to a layer.
singleton
object | object[]Singleton-location rules. Pin a pattern to one file; every other touch is a violation.