[Content Fixer] update-rules-better-javascript — fix 5 issues (outdated JavaScript guidance)#12572
Draft
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Also worth flagging: Trusted Types aren't mentioned. They're the modern defense for DOM XSS involving dynamic code execution - if the rule covers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ContentHawk — Agent 3 (Fixer) Results
Summary
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-javascriptSnapshot
.github/ContentHawk/TODO/2026-04-24_Snapshot_update-rules-better-javascript.mdIssues resolved
Closes #12566
Closes #12567
Closes #12568
Closes #12569
Closes #12570
Changes made
🦅 ContentHawk - Content Audit: Outdated guidance: add progressive enhancement advice #12566 —
do-you-avoid-relying-on-javascript-for-crucial-actions: Added sections on progressive enhancement, modern SSR/SSG architecture (Next.js, Remix, Nuxt, Astro), ARIA roles and focus management for accessibility, and testing strategies for no-JS scenarios. Removed outdated Flash/Java references.🦅 ContentHawk - Content Audit: Update semicolon rule to reflect modern tooling #12567 —
do-you-always-use-semicolons-on-your-js-file: Expanded with concrete ASI pitfall examples (return statement and leading[/(edge cases), added guidance on enforcing consistency via ESLint and Prettier with sample config snippets.🦅 ContentHawk - Content Audit: Modernize jQuery styling guidance #12568 —
do-you-avoid-making-changes-to-individual-css-styles-using-jquery: Added proper code block examples for bad/good jQuery usage, a new section on modern approaches including vanilla JSclassList, CSS variables, and state-driven styling in React/Vue/Angular, plus guidance on when inline style manipulation is acceptable.🦅 ContentHawk - Content Audit: Expand comments guidance for modern JavaScript practices #12569 —
do-you-comment-your-javascript-code: Rewrote to focus on self-documenting code, added JSDoc examples for public APIs, explained how TypeScript types reduce JSDoc boilerplate, fixed thedocument.writeinline code example into a proper code block, and added tooling recommendations (ESLint jsdoc plugin, TypeDoc, JSDoc).🦅 ContentHawk - Content Audit: Add security and CSP notes for eval guidance #12570 —
do-you-know-not-to-use-the-eval-function: Added XSS security risk explanation, CSP ('unsafe-eval') discussion, OWASP reference link, and a lookup-table pattern as a modern safe alternative. Reformatted the original bad/good examples into proper code blocks.contenthawk-fixer-run-id: 24869151762