Repository navigation
fix(rules): core/charset is info, not warn, for a late charset meta when the header agrees #1220 - #1222
Merged
Conversation
|
Reviewed the diff and
Overall this looks good to merge. 🤖 Generated with Claude Code |
…hen the Content-Type header agrees #1220 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/charset-late-meta
branch
from
October 28, 2026 13:08
a559ca2 to
f2712f8
Compare
|
Review: no blocking issues. The change matches the described behaviour.
(nit) |
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.
Closes #1220
What
core/charsetwarned "Charset meta is not within the first 1024 bytes" even when theContent-Typeheader names the same UTF-8 charset. The header decides the decoding before any prescan, so the meta's position is a conformance note there. That case is nowinfo(score-neutral) with the message "The Content-Type header already sets UTF-8; moving the charset meta into the first 1024 bytes is a conformance fix only".Unchanged: no header charset still warns with the old message; a header that conflicts with the meta still gives the conflict warning wherever the meta sits; a non-UTF-8 page (header and meta both
windows-1252) still gets the non-UTF-8 warning;verdictScopestayspage.utf8,UTF-8and a quoted header value count as agreeing.Tests and docs
packages/rules/tests/core-charset.test.ts: the reporter's fixture (a ~7.8 kB inline script before<meta charset>) plus a case per acceptance criterion. Tests that pinned a late meta under an agreeing header aswarnnow run without a header, so they still exercise the detection and still warn.docs/rules/core/charset.mdxdescribes the header-agrees case; CHANGELOG[Unreleased]has the entry.scripts/test-suites.ts --run rules, the rules typecheck andmake validateindocs/.Skill: no change needed.