Conversation
- core: copy the ruleset in verify() so inline <!-- htmlhint --> rules don't mutate the caller's or the default ruleset - tags-check: don't persist custom config in module state across runs - doctype-html5: listen to comment events only, so the listener is actually removed after the first tag - html-lang-require: anchor the BCP47 pattern to the whole value - tag-pair: treat bgsound as a void element Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FN9Si1bR6igGbuoJ7ZGJWb
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
BCP47 validation still needs strict end-of-input handling.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR prevents ruleset/configuration leakage between runs and fixes several HTML rule checks.
Changes:
- Isolates rulesets and
tags-checkconfiguration. - Corrects doctype handling, BCP47 validation, and
bgsoundpairing. - Adds regression tests.
| File | Description |
|---|---|
test/rules/tags-check.spec.js |
Tests configuration isolation. |
test/rules/tag-pair.spec.js |
Tests void bgsound handling. |
test/rules/html-lang-require.spec.js |
Tests invalid language values. |
test/rules/doctype-html5.spec.js |
Tests declaration handling. |
test/core.spec.js |
Tests ruleset isolation. |
src/core/rules/tags-check.ts |
Prevents custom configuration leakage. |
src/core/rules/tag-pair.ts |
Treats bgsound as void. |
src/core/rules/html-lang-require.ts |
Updates BCP47 validation. |
src/core/rules/doctype-html5.ts |
Corrects comment listener lifecycle. |
src/core/core.ts |
Copies rulesets before inline-rule parsing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FN9Si1bR6igGbuoJ7ZGJWb
Deploying htmlhint with
|
| Latest commit: |
593f1d6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0b7290a4.htmlhint.pages.dev |
| Branch Preview URL: | https://fix-rule-state-leaks-and-val.htmlhint.pages.dev |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FN9Si1bR6igGbuoJ7ZGJWb
This branch has not been deployed
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.

core: copy the ruleset in verify() so inline rulesdon't mutate the caller's or the default ruleset
tags-check: don't persist custom config in module state across runsdoctype-html5: listen to comment events only, so the listener isactually removed after the first tag
html-lang-require: anchor the BCP47 pattern to the whole valuetag-pair: treat bgsound as a void element