Skip to content

Commit aaaba63

Browse files
posit-snyk-botsnyk-botclaudecdervCopilot
authored
[Snyk] Security upgrade eslint from 8.57.1 to 10.0.0 (#14038)
* fix: tools/bundle-bug-finder/package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AJV-15274295 * Migrate bundle-bug-finder to ESLint 10 flat config ESLint 10 dropped support for `.eslintrc` files. Replace with `eslint.config.js` flat config. Remove Babel parser dependencies since the default espree parser handles the `no-undef` use case. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix error masking in validate-bundle cleanup Wrap cleanup `Deno.removeSync` calls in try-catch so that failures to remove files that don't yet exist (e.g. when validation fails before creating them) don't mask the real error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Use ecmaVersion "latest" for bundled JS parsing The bundled quarto.js contains import attributes (`with { type: "json" }`) which require ES2025+. Use "latest" so espree tracks the spec automatically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update package/src/common/validate-bundle.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: snyk-bot <snyk-bot@snyk.io> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Christophe Dervieux <cderv@posit.co> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 76b9460 commit aaaba63

4 files changed

Lines changed: 23 additions & 14 deletions

File tree

package/src/common/validate-bundle.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,15 @@ export async function validateBundle(
6666
} finally {
6767
const cleanupFiles = [moveScriptDest, outFile, "package-lock.json", "node_modules"];
6868
cleanupFiles.forEach((file) => {
69-
Deno.removeSync(file, {recursive: true});
69+
try {
70+
Deno.removeSync(file, {recursive: true});
71+
} catch (e) {
72+
if (e instanceof Deno.errors.NotFound) {
73+
// File may not exist if validation failed early
74+
} else {
75+
info(`Failed to remove cleanup file '${file}': ${e instanceof Error ? e.message : String(e)}`);
76+
}
77+
}
7078
})
71-
7279
}
7380
}

tools/bundle-bug-finder/.eslintrc

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default [
2+
{
3+
files: ["**/*.js"],
4+
languageOptions: {
5+
ecmaVersion: "latest",
6+
sourceType: "module",
7+
},
8+
rules: {
9+
"no-undef": "error"
10+
}
11+
}
12+
];
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"name": "dummy",
33
"version": "1.0.0",
4+
"type": "module",
45
"dependencies": {
5-
"@babel/eslint-parser": "^7.23.3",
6-
"@babel/plugin-syntax-import-assertions": "^7.23.3",
7-
"eslint": "^8.53.0"
6+
"eslint": "^10.0.0"
87
}
98
}

0 commit comments

Comments
 (0)