TypeScript · JSON Structure

Typescript Diagnostic Structure

Structural definition of a TypeScript compiler diagnostic

Type: object Properties: 6
CompilerJavaScriptLanguage ServiceProgramming LanguageStatic TypingWeb Development

Typescript Diagnostic Structure is a JSON Structure definition published by TypeScript, describing 6 properties. It conforms to the https://json-schema.org/draft/2020-12/schema meta-schema.

Properties

file start length messageText category code

Meta-schema: https://json-schema.org/draft/2020-12/schema

JSON Structure

typescript-diagnostic-structure.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "TypeScript Diagnostic Structure",
  "description": "Structural definition of a TypeScript compiler diagnostic",
  "type": "object",
  "properties": {
    "file": {
      "type": "object",
      "description": "Source file reference"
    },
    "start": {
      "type": "integer",
      "description": "Character offset of diagnostic start"
    },
    "length": {
      "type": "integer",
      "description": "Diagnostic span length in characters"
    },
    "messageText": {
      "description": "Diagnostic message (string or chained object)"
    },
    "category": {
      "type": "integer",
      "description": "0=Warning, 1=Error, 2=Suggestion, 3=Message"
    },
    "code": {
      "type": "integer",
      "description": "TypeScript error code number"
    }
  }
}