interface DiagnosticsOptions {
    allowComments?: boolean;
    comments?: SeverityLevel;
    enableSchemaRequest?: boolean;
    schemaRequest?: SeverityLevel;
    schemaValidation?: SeverityLevel;
    schemas?: {
        fileMatch?: string[];
        schema?: any;
        uri: string;
    }[];
    trailingCommas?: SeverityLevel;
    validate?: boolean;
}

Properties

allowComments?: boolean

If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. DiagnosticsOptions.allowComments will override this setting.

comments?: SeverityLevel

The severity of reported comments. If not set, 'DiagnosticsOptions.allowComments' defines whether comments are ignored or reported as errors.

enableSchemaRequest?: boolean

If set, the schema service would load schema content on-demand with 'fetch' if available

schemaRequest?: SeverityLevel

The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used.

schemaValidation?: SeverityLevel

The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used.

schemas?: {
    fileMatch?: string[];
    schema?: any;
    uri: string;
}[]

A list of known schemas and/or associations of schemas to file names.

Type declaration

  • Optional Readonly fileMatch?: string[]

    A list of glob patterns that describe for which file URIs the JSON schema will be used. '' and '**' wildcards are supported. Exclusion patterns start with '!'. For example '.schema.json', 'package.json', '!foo*.schema.json', 'foo/**/BADRESP.json'. A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'.

  • Optional Readonly schema?: any

    The schema for the given URI.

  • Readonly uri: string

    The URI of the schema, which is also the identifier of the schema.

trailingCommas?: SeverityLevel

The severity of reported trailing commas. If not set, trailing commas will be reported as errors.

validate?: boolean

If set, the validator will be enabled and perform syntax and schema based validation, unless DiagnosticsOptions.schemaValidation is set to ignore.