Updates Biome & Prettier with linting applied (#96394)

## About The Pull Request
- Update Biome to 2.4.16
- Update prettier to 3.8.3
- Apply biome linting rules to a bunch of files
- Convert some files from common-js to es module

## Changelog
N/A
This commit is contained in:
SyncIt21
2026-06-10 09:08:43 +12:00
committed by GitHub
parent e283070135
commit 2c76673f70
21 changed files with 508 additions and 300 deletions
@@ -1,4 +1,4 @@
import fs from "fs";
import fs from 'node:fs';
const REGEX_COMMENT = /<!--.+?-->/g;
@@ -6,13 +6,13 @@ const REGEX_COMMENT = /<!--.+?-->/g;
const comments = [];
for (const match of fs
.readFileSync(".github/PULL_REQUEST_TEMPLATE.md", { encoding: "utf8" })
.readFileSync('.github/PULL_REQUEST_TEMPLATE.md', { encoding: 'utf8' })
.matchAll(REGEX_COMMENT)) {
comments.push(match[0]);
}
function escapeRegex(string) {
return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
}
export async function removeGuideComments({ github, context }) {
@@ -25,7 +25,7 @@ export async function removeGuideComments({ github, context }) {
).data.body;
if (!originalBody) {
console.log("PR body is empty, skipping...");
console.log('PR body is empty, skipping...');
return;
}
@@ -33,8 +33,8 @@ export async function removeGuideComments({ github, context }) {
for (const comment of comments) {
newBody = newBody.replace(
new RegExp(`^\\s*${escapeRegex(comment)}\\s*`, "gm"),
"\n",
new RegExp(`^\\s*${escapeRegex(comment)}\\s*`, 'gm'),
'\n',
);
}