Skip to content

rule_options ignore: support selectors in [[ignore]] entries (#1262 follow-up) #1440

Closed

Description

@nc9

Summary

[[ignore]] (#1262) waives findings by items and urls. The selectors field is reserved: squirrel config validate refuses it, because most rules do not yet say where in the page an item sits. Criterion 13 of #1262 ("selector ignores are tracked in a follow-up issue") is this issue.

Use case from the original request: a platform renders a country <select> whose option text does not match its aria-label; the merchant cannot change it and wants that one element waived while the same rule keeps reporting their own selects.

[[ignore]]
rule = "a11y/label-content-name-mismatch"
selectors = ["localization-form select"]
reason = "rendered by the platform"

Acceptance Criteria

  • Rules that report a DOM element (the a11y label, form and landmark rules first) put a selector for it on the item, so it can be matched; the field is documented for rule authors.
  • selectors is accepted in an [[ignore]] entry (with rule) and squirrel config validate no longer refuses it; an entry with selectors but none of items, urls or a rule that reports selectors is rejected with a message naming the rule.
  • An item whose selector matches a selectors entry (the same CSS selector forms the page can be queried with, matched against the element's ancestry) is waived exactly like an items match: the check is built from the remaining items, counted as waived, and listed in meta.ignored with its reason.
  • A test with two country-select-shaped elements on one page, one inside localization-form and one outside: only the first is waived and the second is still reported.
  • A selector that matches nothing is listed as unmatched in the report, like an unmatched items entry.
  • --no-ignore shows the unwaived result; with no selectors entries the output is byte-identical to today.
  • docs/configuration/ignore.mdx drops "Reserved" and make validate passes in docs/; the agent skill change is filed as a skills issue if the config reference changes.

Activity

  1. added
    enhancement
    size: L
    rules
    on Oct 31, 2026
  2. added theissue type on Oct 31, 2026
  3. nc9 commented on Nov 1, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.155 (ab4c091b), verified against main: every acceptance criterion is met. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.155

    nik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: L

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions