Skip to content

[Content Fixer] update-rules-better-javascript — fix 5 issues (outdated JavaScript guidance)#12572

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
ContentHawk/fixer/update-rules-better-javascript/1-bb17bc42cee6b838
Draft

[Content Fixer] update-rules-better-javascript — fix 5 issues (outdated JavaScript guidance)#12572
github-actions[bot] wants to merge 1 commit intomainfrom
ContentHawk/fixer/update-rules-better-javascript/1-bb17bc42cee6b838

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

ContentHawk — Agent 3 (Fixer) Results

Summary

Metric Count
Issues fixed 5
Issues skipped 0

Intent

Check if the rules are up to date. Consider modern approaches to JavaScript, such as back-end development with Node.js, or developing complex web applications using frameworks such as React and Angular. Flag rules that are outdated or missing modern context.

Label

update-rules-better-javascript

Snapshot

.github/ContentHawk/TODO/2026-04-24_Snapshot_update-rules-better-javascript.md

Issues resolved

Closes #12566
Closes #12567
Closes #12568
Closes #12569
Closes #12570

Changes made


contenthawk-fixer-run-id: 24869151762

Generated by Content Fixer (Agent 3a) · ● 807.8K ·

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added update-rules-better-javascript Age: 🐣 - Young About 4 hours old Age: 🐥 - Adolescent About 8 hours old Age: 🐤 - Mature About 16 hours old Age: 🐓 - Old About 32 hours old Age: 🍗 - Ancient About 64 hours old and removed Age: 🐣 - Young About 4 hours old Age: 🐥 - Adolescent About 8 hours old Age: 🐤 - Mature About 16 hours old Age: 🐓 - Old About 32 hours old labels Apr 24, 2026
@github-actions github-actions Bot mentioned this pull request Apr 26, 2026
@github-actions github-actions Bot added Age: 🦖 - Extinct About 128 hours old and removed Age: 🍗 - Ancient About 64 hours old labels Apr 26, 2026
@desiorac
Copy link
Copy Markdown

new Function() in the safe alternatives list is misleading. It's also blocked by CSP 'unsafe-eval', so it doesn't belong alongside JSON.parse() and DOMParser. In environments with a strict CSP (which is the point of the rule), both eval() and new Function() are blocked identically. Listing new Function() as an alternative creates a false sense of safety for the main case you want to protect against.

Also worth flagging: Trusted Types aren't mentioned. They're the modern defense for DOM XSS involving dynamic code execution - if the rule covers innerHTML and eval, Trusted Types should be part of the solution space, especially for newer frameworks where it's enforceable via CSP require-trusted-types-for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment