diff --git a/tools/lint-md/lint-md.mjs b/tools/lint-md/lint-md.mjs index f623be28130edf..507a25070d9070 100644 --- a/tools/lint-md/lint-md.mjs +++ b/tools/lint-md/lint-md.mjs @@ -29178,7 +29178,7 @@ paths.forEach(async (path) => { const file = await read(path); const result = await linter.process(file); if (format) { - fs.writeFileSync(path, String(result)); + fs.writeFileSync(path, result.toString()); } else if (result.messages.length) { process.exitCode = 1; console.error(reporter(result)); diff --git a/tools/lint-md/lint-md.src.mjs b/tools/lint-md/lint-md.src.mjs index ed32f7e1afb1cf..e990b5317248d6 100644 --- a/tools/lint-md/lint-md.src.mjs +++ b/tools/lint-md/lint-md.src.mjs @@ -32,7 +32,7 @@ paths.forEach(async (path) => { const file = await read(path); const result = await linter.process(file); if (format) { - fs.writeFileSync(path, String(result)); + fs.writeFileSync(path, result.toString()); } else if (result.messages.length) { process.exitCode = 1; console.error(reporter(result));