Index Lint
API reference for @crux/core/lint rule metadata, findings, profiles, and suppressions.
import type { IndexLintFinding, CruxLintConfig } from '@crux/core/lint'Index lint is the authored-graph lint contract used by crux dev, crux lint, the web devtools, and the TUI. Lint findings describe actionable issues in source-authored Crux definitions. They are separate from index diagnostics, which describe indexer health.
CruxLintConfig
interface CruxLintConfig {
profile?: 'off' | 'recommended' | 'strict' | 'experimental'
rules?: Record<
string,
{
enabled?: boolean
severity?: 'info' | 'warning' | 'error'
}
>
}Profiles
| Profile | Description |
|---|---|
recommended | Default rules with high signal and low noise. |
strict | Adds stronger product-health checks. |
experimental | Includes rules still being proven. |
off | Disables index lint findings for the project. |
IndexLintFinding
interface IndexLintFinding {
id: string
severity: 'info' | 'warning' | 'error'
ruleId: string
category: CruxLintCategory
maturity: 'stable' | 'preview' | 'experimental'
confidence: 'high' | 'medium' | 'low'
profiles: Array<'recommended' | 'strict' | 'experimental'>
title: string
message: string
rationale: string
impact?: string
source?: SourceLocation
primaryDefinitionId?: string
relatedDefinitionIds: string[]
affectedDefinitionIds?: string[]
evidence: IndexLintEvidence[]
fixes: IndexLintFix[]
docsUrl: string
suppression?: IndexLintSuppression
propagatedDefinitionIds?: string[]
propagationPaths?: IndexLintPropagationPath[]
}| Field | Description |
|---|---|
message | Concrete "what happened" text. |
rationale | Per-rule "why it matters" text. |
impact | Optional user/system consequence. |
evidence | Backend-owned evidence explaining why the finding exists. |
fixes | Actionable fix paths, docs links, or suppression affordances. |
docsUrl | Rule reference page. |
suppression | Exact suppression comment the UI can show. |
Clients should render findings directly. Do not recompute rules client-side by walking index relations.
Injection-aware lint rules use the Project Index injection read model. They can point at prompt input fields contributed by contexts or injectables, explain conditional branches, and mark runtime-dependent dependencies or tool surfaces when static source cannot fully describe the composition.
Suppressions
Rule-specific source suppressions use comments:
// crux-lint-disable-next-line tool.missing_input_schema -- generated adapter
// crux-lint-disable-line definition.missing_eval_coverage -- covered externally
/* crux-lint-disable-file definition.missing_eval_coverage -- prototype */Unknown rule ids and unused suppressions are index diagnostics.
Rule References
Rule-specific API/reference pages live under Index Lints.
Related
- Guide: Index Lint
- Reference: Project Index
- Reference: @crux/local