OXC.Lint.TypeAware.DiagnosticPayload (OXC v0.18.0)

Copy Markdown View Source

tsgolint diagnostic frame. :rule findings always carry a rule, range, and file.

Summary

Functions

Decodes a JSON string into this struct.

Decodes a JSON string into this struct, raising on failure.

Dumps this struct into JSON-shaped data, respecting JSON field names.

Builds this struct from a decoded JSON map.

Builds this struct from a decoded JSON map, raising on failure.

Decode tsgolint's numeric diagnostic kind: 0 for rule findings, 1 for internal diagnostics.

Returns a JSON Schema-compatible schema map.

Types

t()

@type t() :: %OXC.Lint.TypeAware.DiagnosticPayload{
  file_path: String.t() | nil,
  fixes: [OXC.Lint.TypeAware.Fix.t()],
  kind: :rule | :internal,
  labeled_ranges: [OXC.Lint.TypeAware.LabeledRange.t()],
  message: OXC.Lint.TypeAware.RuleMessage.t(),
  range: OXC.Lint.TypeAware.Range.t() | nil,
  rule: String.t() | nil,
  suggestions: [OXC.Lint.TypeAware.Suggestion.t()]
}

Functions

decode(json)

Decodes a JSON string into this struct.

decode!(json)

Decodes a JSON string into this struct, raising on failure.

dump(struct)

Dumps this struct into JSON-shaped data, respecting JSON field names.

from_map(map)

Builds this struct from a decoded JSON map.

from_map!(map)

Builds this struct from a decoded JSON map, raising on failure.

kind(arg1)

Decode tsgolint's numeric diagnostic kind: 0 for rule findings, 1 for internal diagnostics.

schema()

Returns a JSON Schema-compatible schema map.