Repository navigation
Conversation
nc9
force-pushed
the
feat/ignore-selectors-1440
branch
2 times, most recently
from
November 1, 2026 05:35
ada6f23 to
5ee4b62
Compare
…s, for label-content-name-mismatch, form-labels and select-name #1440 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
feat/ignore-selectors-1440
branch
from
November 1, 2026 05:54
5ee4b62 to
46bd1a1
Compare
Merged
Contributor
Author
|
Landed in v0.0.155 as nik |
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 #1440.
[[ignore]]entries now takeselectors: a waiver names an element by where it sits, so a rule keeps reporting the merchant's own elements while it waives the one a platform renders.CheckItem.selector(new, optional): the element's ancestry ashtml > body > form#f > select#s.c, built byelementSelector(el)(packages/rules/src/element-path.ts: tag,#id,.classtokens of letters, digits,_,-; nearest 24 ancestors; at most 8 classes).RuleMeta.itemSelectorsmarks rules that set it.a11y/label-content-name-mismatch,a11y/form-labelsanda11y/select-namedo (and now setmessageCountsItems, so the message count follows the waiver).ignore-selector.ts): tag or*,#id,.class, descendant and>; up to 12 parts and 300 characters; matched right to left with memoisation (parts x segments). Attribute selectors, pseudo-classes,+,~, lists are refused with a message bysquirrel config validateand the entry is not applied.ignore.ts): selector matchers compile per entry; an item is waived when its selector matches, ANDed withitemsandurls; waived items are counted and listed inmeta.ignoredlikeitems; an entry that matched nothing is reported as before; selectors are in the entry's cache signature; an entry with only selectors is not a page waiver.selectorfrom every item after the ignore filter (waivers or not), so no output carries it and a run with no selector entry is byte-identical. A test compares the check list with no entry against one whose entry matched nothing.selectorsaccepted (1 to 100 entries of 1 to 300 chars); an entry needsitems,urlsorselectors.checkIgnoreEntries: an entry with only selectors for rules that report no element path is a validate problem naming the rule.ignore-selectors-1440.test.ts(12: the issue's two country selects, one inside<localization-form>and one outside, only the first waived; both waived; unmatched; items AND selectors; the language; refusal messages; deep-path bound; validate problems), config schema,config validateCLI, plus the two existing tests that asserted the old refusal/shape.docs/configuration/ignore.mdx(field table, Selectors section, rule authors), CHANGELOG under Unreleased / Added.make validatepasses.Limits stated in the docs: a waiver applies to the items a rule lists (these three list the first ten); the recorded place covers 24 ancestors and omits a name with other characters.
Review round 3 (tests, docs): the path is computed only for a rule an entry with
selectorsnames (a runner-level spy onelementSelectorsees 0 calls with no entry, with another rule's entry and with an items-only entry; each of the three rules builds no path when the flag is unset); the class slice, the per-element cache and the segments-squared charge are each pinned by a test that fails without them; the hostile "409 KB class and 5,000 controls" test now asserts the outcome (all 5,000 waived, check passes,meta.ignoreditems 5,000). Docs: an ancestor with a tag name likeo:porsvg:xmakes the path unparseable so selectors never match it (fails closed); selector matching shares the audit-wide 50M step pool with regex and glob entries; about 100 MB per 100,000 reported elements at the 1,000-character path cap while an entry names the rule.Skill: needs a change (the config reference gains
selectors): the maintainer files the privateskillsissue.nik