{ aliasName: string; file: string; message: string; severity: "error" | "warning"; kind: "alias_lost"; line?: number | undefined; column?: number | undefined; } import {AliasLostDiagnostic} from 'svelte-docinfo/diagnostics.js'; An exported type alias loses its name at use sites.
The alias's right-hand side (an indexed access or conditional —
z.infer<typeof S>, valibot's InferOutput) resolves to a pre-existing
interned type that TypeScript never retroactively stamps an alias symbol
on, so unannotated positions document the expansion instead of the name.
Fires only where nothing self-heals: a loss the alias registry recovers
(typeInfo emits {kind: 'reference', name} at use sites) is suppressed,
as are literal-only unions (z.enum outputs) and brand-like intersections
(.brand()) — readable degradations with no author-side fix worth
demanding. @nodocs on the declaration suppresses. The author-side escape
for a flagged alias is a nominal symbol, e.g.
interface Foo extends z.infer<typeof S> {} where applicable.
Always warning, query-time category (recomputed each query()).
aliasName
Name of the alias whose right-hand side resolves to a nameless type.
type string
file
File path relative to project root (no leading slash, no ./ prefix).
Normalized at every public API boundary — session.setFile/setFiles
(ingest-time), session.query (query-time, via analyzeCore), and the
one-shot wrappers analyze / analyzeFromFiles. Producers inside the
pipeline may write absolute or virtual paths (e.g.,
Foo.svelte.__svelte2tsx__.ts); normalization rewrites them to
project-relative form before they reach consumers.
The exception is discovery — discoverSourceFiles /
discoverFromExports return their diagnostics unnormalized, since they
run before any session exists. Their file is already
project-root-relative, but message can embed an absolute path (an fs
error names the file it failed on), so a consumer wiring discovery up
itself owns the normalizeDiagnosticPaths call — analyzeFromFiles and
the Vite plugin both make it before merging.
The absolute form is the one to write. Normalization deliberately
leaves an already-relative path alone (relativizing it would resolve
against cwd), so a producer writing a ModuleJson.path — relative to
sourceRoot, a different base — passes through untouched and publishes
the same file under a second name. Absolute is what the pass can
actually correct.
type string
message
Human-readable description of the issue.
type string
severity
type "error" | "warning"
kind
type "alias_lost"
line?
Line number (1-based), absent if location unavailable.
type number
column?
Column number (1-based), absent if location unavailable.
type number