forked from aws/aws-sdk-js-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-wasm-fmt-biome.mjs
More file actions
35 lines (32 loc) · 943 Bytes
/
run-wasm-fmt-biome.mjs
File metadata and controls
35 lines (32 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import init, { format } from "@wasm-fmt/biome_fmt";
import { promises } from "node:fs";
import walk from "../utils/walk.js";
await init();
export const runWasmFmtBiome = async (dir) => {
for await (const file of walk(dir)) {
if (file.endsWith(".ts") || file.endsWith(".js")) {
if (file.endsWith("ruleset.ts")) {
continue;
}
promises.readFile(file, "utf-8").then((contents) => {
promises.writeFile(
file,
format(contents, file, {
indent_style: "space",
indent_width: 2,
line_width: 120,
line_ending: "lf",
quote_properties: "as-needed",
arrow_parentheses: "always",
semicolons: "always",
bracket_spacing: true,
bracket_same_line: false,
quote_style: "double",
trailing_comma: "all",
}),
"utf-8"
);
});
}
}
};