From 21aa25c85db75733504babc61a201187e302d18a Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Wed, 8 Jan 2025 21:15:18 +0800 Subject: [PATCH] Fix biome correctness checks (#12929) --- benchmark/make-project/_template.js | 2 ++ packages/astro/src/core/build/static-build.ts | 3 ++- scripts/cmd/build.js | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmark/make-project/_template.js b/benchmark/make-project/_template.js index 00ebdc4737b7..dd392138e91b 100644 --- a/benchmark/make-project/_template.js +++ b/benchmark/make-project/_template.js @@ -3,4 +3,6 @@ * previous artifacts here before generating files. * @param {URL} projectDir */ +// biome-ignore lint/correctness/noUnusedVariables: parameters here are template placeholders +// biome-ignore lint/correctness/noUnusedFunctionParameters: (same as above) export async function run(projectDir) {} diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index ba0811c840c6..71046956c8ce 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -366,7 +366,8 @@ async function cleanServerOutput( files.map(async (filename) => { const url = new URL(filename, out); const map = new URL(url + '.map'); - await Promise.all([fs.promises.rm(url), fs.promises.rm(new URL(map)).catch((e) => {})]); + // Sourcemaps may not be generated, so ignore any errors if fail to remove it + await Promise.all([fs.promises.rm(url), fs.promises.rm(map).catch(() => {})]); }), ); diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index d5a9336d85df..2cc99b7d305b 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -48,7 +48,6 @@ export default async function build(...args) { const noClean = args.includes('--no-clean-dist'); const bundle = args.includes('--bundle'); const forceCJS = args.includes('--force-cjs'); - const copyWASM = args.includes('--copy-wasm'); const { type = 'module', dependencies = {} } = await readPackageJSON('./package.json');