Skip to content

Commit a88ec22

Browse files
committed
chore(scripts): replace stripComments with decomment
1 parent 2813222 commit a88ec22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/downlevel-dts/downlevelWorkspace.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// @ts-check
22
import { exec } from "child_process";
3+
import decomment from "decomment";
34
import { access, readFile, writeFile } from "fs/promises";
45
import { join } from "path";
56
import prettier from "prettier";
6-
import stripComments from "strip-comments";
77
import { promisify } from "util";
88

99
import { getAllFiles } from "./getAllFiles.mjs";
@@ -40,9 +40,9 @@ export const downlevelWorkspace = async (workspacesDir, workspaceName) => {
4040
for (const downlevelTypesFilepath of files) {
4141
try {
4242
const content = await readFile(downlevelTypesFilepath, "utf8");
43-
const strippedContent = stripComments(content);
43+
const decommentedContent = decomment(content);
4444
try {
45-
const formatted = prettier.format(strippedContent, { parser: "typescript" });
45+
const formatted = prettier.format(decommentedContent, { parser: "typescript" });
4646
await writeFile(downlevelTypesFilepath, formatted);
4747
} catch (error) {
4848
console.warn(`Failed to format "${downlevelTypesFilepath}". Skipping...`);

0 commit comments

Comments
 (0)