Repository navigation
feat(lint): @astryx/no-unguarded-ime-keydown — enforce IME composition guards - #4909
Merged
nynexman4464 merged 1 commit intoAug 17, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
nynexman4464
force-pushed
the
nynexman4464/lint/no-unguarded-ime-keydown
branch
from
August 11, 2026 22:23
0df0b2a to
8dcbaa4
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsDateInput (@astryxdesign/core) · View in Storybook
DateTimeInput (@astryxdesign/core) · View in Storybook
MultiSelector (@astryxdesign/core) · View in Storybook
NumberInput (@astryxdesign/core) · View in Storybook
Selector (@astryxdesign/core) · View in Storybook
TimeInput (@astryxdesign/core) · View in Storybook
Typeahead (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
nynexman4464
force-pushed
the
nynexman4464/lint/no-unguarded-ime-keydown
branch
from
August 11, 2026 23:47
8dcbaa4 to
5442408
Compare
cixzhang
approved these changes
Aug 12, 2026
nynexman4464
force-pushed
the
nynexman4464/lint/no-unguarded-ime-keydown
branch
from
August 17, 2026 15:21
5442408 to
ffcc49b
Compare
nynexman4464
force-pushed
the
nynexman4464/lint/no-unguarded-ime-keydown
branch
from
August 17, 2026 15:44
ffcc49b to
c3e039f
Compare
New ESLint rule in the internal @AstryX plugin. Flags an onKeyDown on an editable surface (input/textarea/contentEditable, role textbox/searchbox/ combobox, or a known Astryx text-input component) that branches on command keys (Enter/Escape/arrows/Home/End/PageUp/PageDown, or legacy keyCode) without an IME composition guard (isImeKeyEvent / isComposing / keyCode 229). This makes IME-composition safety a property CI enforces rather than a bug we keep rediscovering one component at a time. Pragmatic AST + source-text-scan heuristic (matching sibling rules), not dataflow: it resolves the handler from an inline function or a same-file identifier, excludes non-composable input types (checkbox/number/date/...) and non-editable roles (button/link/menuitem/tab/option), and treats any isImeKeyEvent(/.isComposing/229 mention in the handler as guarded (favouring false-negatives over noise). Enabled at 'error' in both tiers: every editable command-key handler in core now guards composition (the six sites fixed in the parent commit), so this prevents regressions. Verified against the pre-fix code that it flags exactly those six files, and zero after the fix. 17 rule tests; canonical guard is utils/ime#isImeKeyEvent. Closes #4892.
nynexman4464
force-pushed
the
nynexman4464/lint/no-unguarded-ime-keydown
branch
from
August 17, 2026 22:06
c3e039f to
48f182c
Compare
github-actions
Bot
deleted the
nynexman4464/lint/no-unguarded-ime-keydown
branch
August 18, 2026 06:11
31 of 40 tasks
This branch was successfully deployed
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.
Why
The IME-composition bug keeps coming back one component at a time (#4860, then the six sites in the parent PR) because nothing enforces the guard — each fix has been reactive, after a user hit it. This rule makes IME-composition safety a property CI checks, so new editable surfaces (including AI-generated code) can't reintroduce it silently. Closes #4892.
What
Flags an
onKeyDownon an editable surface —<input>/<textarea>/contentEditable,role="textbox"|"searchbox"|"combobox", or a known Astryx text-input component — that branches on command keys without a composition guard. It's a pragmatic AST + source-text-scan heuristic (matching the sibling rules), not dataflow:<input>types (checkbox/number/date/…) and non-editable roles (button/link/menuitem/tab/option), so e.g. a<button role="combobox">trigger isn't a false positive.isImeKeyEvent(/.isComposing/229mention in the handler as guarded — deliberately favouring false-negatives over noise (a chatty rule gets disabled).Enabled at
errorin both tiers: with the parent PR fixing every editable command-key handler in core, this locks the door behind us.Risk
Low. Known false-negatives are documented (variable-keyed comparisons, cross-file handler indirection, spread
role/type); it points at the canonicalutils/ime#isImeKeyEventas the fix.Testing
17 rule tests (valid: guarded handlers, Tab-only, buttons; invalid: the real Selector/Typeahead shapes). Verified against the pre-fix code that the rule flags exactly the six originally-identified files, and zero after the fix. Full 301-test plugin suite green; real repo eslint (strict/CI) passes on all six fixed components.
Third of a 3-PR stack (shared base → editable-field fixes → this).
@cixzhang