[CLASS-13991] Add no-rtl-icon-swap ESLint rule - #3175
Draft
maddy531 wants to merge 4 commits into
Draft
Conversation
Whitelists reading-direction glyphs and flips them under :dir(rtl). Which icons mirror is owned by Wonder Blocks — update directional-icons.ts rather than handling RTL at the call site. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the RTL whitelist as an explicit source of truth so PhosphorIcon and follow-on tooling (e.g. lint) can share the same list without editing the matching helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: a8976a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Size Change: +1.15 kB (+0.86%) Total Size: 134 kB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-nxfxvmsmqc.chromatic.com/ Chromatic results:
|
Chromatic/Storybook production builds emit `arrow-right-[hash].svg`. Suffix-only matching missed those, so glyphs never got the mirror class even though flex layout reversed under dir=rtl. Co-authored-by: Cursor <cursoragent@cursor.com>
Flag RTL ternaries that swap Phosphor icons on the mirroring whitelist so call sites cannot double-flip once PhosphorIcon auto-mirrors. Co-authored-by: Cursor <cursoragent@cursor.com>
maddy531
force-pushed
the
CLASS-13991.no-rtl-icon-swap
branch
from
August 11, 2026 18:18
f0da0c7 to
a8976a5
Compare
maddy531
force-pushed
the
CLASS-13991.rtl-directional-icons
branch
from
August 11, 2026 18:51
d16c894 to
f124ade
Compare
maddy531
force-pushed
the
CLASS-13991.rtl-directional-icons
branch
from
August 20, 2026 13:50
72980b9 to
28788bc
Compare
maddy531
force-pushed
the
CLASS-13991.rtl-directional-icons
branch
from
August 31, 2026 14:31
7e36805 to
976777e
Compare
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
@khanacademy/wonder-blocks/no-rtl-icon-swapto catch RTL ternaries that swap any Phosphor icon on the mirroring whitelist (carets, arrows,sign-in/sign-out, indent/outdent, etc.).MIRRORED_ICON_NAMESin the eslint plugin (no React dependency) with a sync test againstwonder-blocks-icon.errorinrecommended.Stacked on #3174 (
CLASS-13991.rtl-directional-icons). Merge the base RTL mirroring PR first; this PR only touches the eslint plugin / its docs.Test plan
pnpm exec jest packages/eslint-plugin-wonder-blocks/src/rules/__tests__/no-rtl-icon-swap.test.ts packages/eslint-plugin-wonder-blocks/src/data/__tests__/mirrored-icon-names.test.tsmirrored-icon-names.tsin wonder-blocks-iconpackages/eslint-plugin-wonder-blocks/demo/src/no-rtl-icon-swap-example.tsxmain(or merge stack as-is)Made with Cursor