Skip to main content

report_to_json

Function report_to_json 

Source
pub fn report_to_json(path: Option<&str>, report: &CheckReport) -> Value
Expand description

Per-file object of the surf-lint JSON envelope.

path is the file label; pass None for in-memory input (e.g. the wasm check_json export) and the path key is omitted entirely. Diagnostics are the Diagnostic serde serialization verbatim: spans carry line numbers and byte offsets, fix payloads (description, safety, edits) ride along when present, and span/code/fix keys are omitted when None.