Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions apps/oxlint/src-js/plugins/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { walkProgram } from '../generated/walk.js';
// @ts-expect-error we need to generate `.d.ts` file for this module
import { walkProgram } from "../generated/walk.js";

import type { SetOptional } from "type-fest";
import type { DiagnosticReport } from "../plugins/report.ts";
import type { AfterHook, BufferWithArrays } from "./types.ts";

// Buffers cache.
Expand Down Expand Up @@ -63,11 +61,8 @@ export function lintFile(
try {
lintFileImpl(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJSON);

// Remove `messageId` field from diagnostics. It's not needed on Rust side.
for (let i = 0, len = diagnostics.length; i < len; i++) {
(diagnostics[i] as SetOptional<DiagnosticReport, "messageId">).messageId = undefined;
}

// Note: `messageId` field of `DiagnosticReport` is not needed on Rust side, but we assume it's cheaper to leave it
// in place and let `serde` skip over it on Rust side, than to iterate over all diagnostics and remove it here.
return JSON.stringify({ Success: diagnostics });
} catch (err) {
return JSON.stringify({ Failure: getErrorMessage(err) });
Expand Down
Loading