interface Diagnostic {
    category: 0 | 1 | 2 | 3;
    code: number;
    file: {
        fileName: string;
    };
    length: number;
    messageText: string | DiagnosticMessageChain;
    relatedInformation?: DiagnosticRelatedInformation[];
    reportsDeprecated?: {};
    reportsUnnecessary?: {};
    source?: string;
    start: number;
}

Hierarchy (view full)

Properties

category: 0 | 1 | 2 | 3

Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3

code: number
file: {
    fileName: string;
}

TypeScriptWorker removes all but the fileName property to avoid serializing circular JSON structures.

Type declaration

  • fileName: string
length: number
messageText: string | DiagnosticMessageChain
relatedInformation?: DiagnosticRelatedInformation[]
reportsDeprecated?: {}

Type declaration

    reportsUnnecessary?: {}

    May store more in future. For now, this will simply be true to indicate when a diagnostic is an unused-identifier diagnostic.

    Type declaration

      source?: string
      start: number