pub fn to_json_string( diagnostics: &[Diagnostic], source_map: &SourceMap, ) -> Result<String, Error>
Serialize diagnostics to a JSON string.