tcmts.cli.lint

Types

DefinitionLint type
LintIssue type
LintTraits type
What the code being linted uses, which decides the plugins.
OxlintDiagnostic type
UserConfig type

Server

configFor (cb: Codebase, traits: LintTraits) => { file: string; key: string; bin: string; }
The oxlint configuration for code with these traits: written to .tcm/lint, keyed by its content.
lintDefinitions (cb: Codebase, targets: { hash: string; path: string; }[], fresh?: boolean) => DefinitionLint[]
Lint stored definitions, as `tcm view` shows them (current names, imports, `export`), cached by hash and the linter's version and configuration. `fresh` lints again regardless.
lintScratch (cb: Codebase, file: string, text: string) => LintIssue[]
Lint a scratch file as written (an editor's buffer, say). Offsets are in `text`.
lintTexts (cb: Codebase, texts: { text: string; ext: string; }[], traits: LintTraits) => LintIssue[][]
Lint texts (each with the extension it needs, `.ts` or `.tsx`) with one oxlint run: the issues of each.
provideTool (cb: Codebase, name: string) => { module: string; dir: string; version: string; }
A tool tcm provides: the one it ships, or installed in the cache as `toolModule` says (there already, if it was installed with other packages, as a test runner's are).
toolModule (cb: Codebase, name: string) => string | undefined
What a tool tcm provides is installed as in the codebase's cache (`npm:vitest@5`), or undefined when it's the one tcm ships (`shippedPackage`), unless the codebase settled on a range that one isn't in (chosen with `tcm upgrade <tool>@<range>`, or the one its tests import Vitest at): at that range, else the newest release's. For installing several at once (`provideTool` installs one).
userConfig (cb: Codebase) => UserConfig
The codebase's `lint.config`: its value, and the packages it imports, which are its JS plugins.

Shared

LINT_CONFIG "lint.config"
The path a codebase's lint configuration is a definition at.
LINT_FORMAT 2
How tcm lints, as part of a finding's cache key: a change to what tcm keeps of oxlint's findings lints again. 2: findings about a definition's own cycle-mates as imports are dropped.
TOOLS Set<string>
The tools tcm provides (no definition imports them: tcm runs them).
apartFromItsCycle (issue: { rule: string; message: string; start: number; }, text: string, mates: Set<string>) => boo…
Findings that come from linting a definition apart from the ones stored with it. Definitions that refer to each other are one module where they run, but each is linted as `tcm view` shows it, the others imported: assigning to one (a `let` they share) isn't assigning to an import, and an import only assigned to isn't unused.
locate (text: string, offset: number) => { line: number; col: number; source: string; }
`line:col` of an offset in `text` (1-based), and the line itself.
toolRange (cb: Codebase, name: string) => string | undefined
The range a tool runs at: the one chosen for it, else the newest the codebase locks (none if it's never run).
traitsOfText (file: string, text: string) => LintTraits

Tests

testCycleMatesArentImportsToLint () => void