diff --git a/package/src/common/validate-bundle.ts b/package/src/common/validate-bundle.ts index 1bfda0ebaf7..0d046a22090 100644 --- a/package/src/common/validate-bundle.ts +++ b/package/src/common/validate-bundle.ts @@ -66,8 +66,15 @@ export async function validateBundle( } finally { const cleanupFiles = [moveScriptDest, outFile, "package-lock.json", "node_modules"]; cleanupFiles.forEach((file) => { - Deno.removeSync(file, {recursive: true}); + try { + Deno.removeSync(file, {recursive: true}); + } catch (e) { + if (e instanceof Deno.errors.NotFound) { + // File may not exist if validation failed early + } else { + info(`Failed to remove cleanup file '${file}': ${e instanceof Error ? e.message : String(e)}`); + } + } }) - } } diff --git a/tools/bundle-bug-finder/.eslintrc b/tools/bundle-bug-finder/.eslintrc deleted file mode 100644 index 1a229cbc87f..00000000000 --- a/tools/bundle-bug-finder/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "parser": "@babel/eslint-parser", - "parserOptions": { - "requireConfigFile": false, - "babelOptions": { - "plugins": ["@babel/plugin-syntax-import-assertions"] - } - } -} diff --git a/tools/bundle-bug-finder/eslint.config.js b/tools/bundle-bug-finder/eslint.config.js new file mode 100644 index 00000000000..33d0bf88ae2 --- /dev/null +++ b/tools/bundle-bug-finder/eslint.config.js @@ -0,0 +1,12 @@ +export default [ + { + files: ["**/*.js"], + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, + rules: { + "no-undef": "error" + } + } +]; diff --git a/tools/bundle-bug-finder/package.json b/tools/bundle-bug-finder/package.json index 385c8e6cd9f..3ffc0a6156e 100644 --- a/tools/bundle-bug-finder/package.json +++ b/tools/bundle-bug-finder/package.json @@ -1,9 +1,8 @@ { "name": "dummy", "version": "1.0.0", + "type": "module", "dependencies": { - "@babel/eslint-parser": "^7.23.3", - "@babel/plugin-syntax-import-assertions": "^7.23.3", - "eslint": "^8.53.0" + "eslint": "^10.0.0" } }