v0.2.1
Patch — sharper definition of lint fail vs caveat. Triggered by
real-world dogfood: a <div onClick={onClose} role="dialog"> modal
backdrop fired fail for GN1210100E ("missing keyboard handler"),
but the keyboard close path lived in a sibling <button aria-label="關閉">
plus a top-of-component useHotkeys("esc", onClose) — both invisible
to single-file AST. Marking such cases fail is wrong: AST literally
cannot prove the violation, only suggest review.
Changed
RuleMetagainsruntime_authoritative: bool = False. Rules whose
verdict requires rendered DOM, computed CSS, focus traversal, or
cross-file event wiring (which AST cannot reach) set this toTrue.lintrunner now downgradesfail→caveatfor any rule with
runtime_authoritative=True, appending an explanatory note to the
message: 「lint 無法跨檔/runtime 確認,請人工或 a11y-moda scan 驗證」.
scanis unaffected — it has Playwright + computed style and can
emitfailauthoritatively for the same rules.- Marked
runtime_authoritative=True:GN1210100E— onClick / mouse handler missing keyboard equivalent
(cross-fileuseHotkeys/ sibling button invisible to AST)FA2141104E—<style>outline:none without:focusrule
(external CSS files invisible to lint)
- Other lint rules already emit
infoorcaveatand are unaffected.
Notes
- This is a definition fix, not a tuning knob.
lint'sfail
status now means "AST proved a violation"; ambiguous cases are
caveatregardless of runtime severity. Users who want hard
keyboard gating in CI should runa11y-moda scan(which has the
evidence to fail). - Per-project
--ignore/ config file is not added in this patch
(YAGNI). Will revisit if real demand surfaces. - Dogfood after patch: light-design AAA, 135 files, 0 fail / 31 caveat
/ 0 info (real<div onClick>accordions in Footer + Faq were fixed
to<button type="button">between releases; Modal backdrop cleanly
downgrades to caveat with the new note).