feat: add includeIncomplete=false option to exclude axe-core incomplete results#808
Open
alexander-turner wants to merge 1 commit into
Open
Conversation
…ults Axe-core's "incomplete" results are items it couldn't automatically verify, not actual accessibility violations. On pages with rich content (math symbols, pseudo-elements, SVG foreignObject, overlapping backgrounds), these produce hundreds of false positives with no CSS fix since the contrast ratios are correct — axe just can't confirm them programmatically. This adds a boolean `includeIncomplete` option (default `true` for backward compatibility). When set to `false`, the axe runner only returns `result.violations`, excluding `result.incomplete`. - Available via JS API (`includeIncomplete: false`) and CLI (`--no-include-incomplete`) - Default `true` preserves existing behavior (non-breaking change) - Includes unit tests for all three states (true, false, unset) - Updates README documentation Relates to pa11y#442 and pa11y/pa11y-ci#124
includeIncomplete=false option to exclude axe-core incomplete results
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.
Summary
Add a boolean
includeIncompleteoption (defaulttrue) that cleanly excludes axe-core's "incomplete" (needs-review) results without affecting violation reporting.Motivation
#707 requested filtering out incomplete results and was closed as resolved by #685 (
levelCapWhenNeedsReview). The workaround caps incomplete items to a lower severity and then excludes that level:{ "levelCapWhenNeedsReview": "warning", "includeWarnings": false }This has a real trade-off: it also suppresses genuine violation warnings. For example,
heading-order(skipped heading levels like h1 → h3) reportsmoderateimpact, which pa11y maps towarning. The workaround silently drops it along with the incomplete items.includeIncomplete: falsesolves this precisely — it excludes only incomplete results while preserving all violation severities.The false-positive problem
On pages with rich content (math symbols, pseudo-elements, SVG foreignObject, overlapping backgrounds), axe-core's incomplete results produce hundreds of non-actionable items (e.g.
nonBmp,bgOverlap,pseudoContent,shortTextContent). These aren't violations — axe just can't confirm them programmatically.Relates to #707, #442, #623, #633, #697, and pa11y/pa11y-ci#124.