@versatiles/style
    Preparing search index...

    Type Alias Diagnostic<C>

    Diagnostic: C extends unknown
        ? {
            code: C;
            data: DiagnosticData[C];
            message: string;
            optionPath?: string;
            origin?: DiagnosticOrigin;
            severity: Severity;
        }
        : never

    One diagnostic. Discriminated on code, so switch (d.code) narrows d.data to that code's payload with no cast — which is the point of typing the payloads at all.

    Written as a distributive conditional over the code union rather than as one object with a generic data, which is what makes the narrowing work; the shape is spelled out inline so that no helper type of its own leaks into the published API.

    Type Parameters