feat(lint): Add configurable rtlActiveValues and invalid-rtl-variant-value rule#81
Merged
alexey1312 merged 4 commits intomainfrom Apr 7, 2026
Merged
feat(lint): Add configurable rtlActiveValues and invalid-rtl-variant-value rule#81alexey1312 merged 4 commits intomainfrom
alexey1312 merged 4 commits intomainfrom
Conversation
…value rule Add `rtlActiveValues` PKL config field (default `["On"]`) that controls which RTL variant values are skipped during export. Previously hardcoded to `"On"`, now designers using `true/false` or other conventions can configure this per-entry. New lint rule `invalid-rtl-variant-value` validates that RTL variant property values match the configured active values and their known counterparts (On↔Off, true↔false, True↔False, Yes↔No, 0↔1). Also improves the empty component error message to show both the icon name and variant name: `car (RTL=true)` instead of just `RTL=true`.
- Fix hardcoded "RTL=On" in ImageLoaderBase log message and comments - Include rtlActiveValues in dedup key for InvalidRTLVariantValueRule - Add tests for shouldSkipAsRTLVariant with custom activeValues - Add rtlActiveValues pass-through assertion in IconsLoaderConfigTests - Test validValues with custom value not in knownPairs - Fix doc comment accuracy in InvalidRTLVariantValueRule - Improve Configuration.md example with separate default/alternative
There was a problem hiding this comment.
Code Review
This pull request introduces the InvalidRTLVariantValueRule to validate RTL variant property values in Figma against a configurable list of active values (rtlActiveValues). The changes span the configuration schemas, the export pipeline across all platforms, and include comprehensive tests and documentation. Review feedback identifies several improvement opportunities in the lint rule's logic: it should correctly handle disabled RTL detection when rtlProperty is null, extend validation to include image entries, and align its frame/page name fallbacks with the exporters. A performance optimization was also suggested to pre-calculate valid value sets outside the component iteration loop.
…allbacks - Skip entries with nil rtlProperty (user explicitly disabled RTL) - Collect both icons and images entries for validation - Apply common.icons/images frame/page name fallbacks - Pre-calculate validValues outside component loop - Add test for nil rtlProperty skipping
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.
Description
rtlActiveValuesPKL config field to control which variant values mean "active RTL" (default:["On"]), replacing hardcoded"On"checkinvalid-rtl-variant-valuelint rule that validates RTL variant property values against configured active values and their known counterparts (On↔Off, true↔false, True↔False, Yes↔No, 0↔1)rtlActiveValuesthrough all platform entry bridges, loader configs, context implementations, andImageLoaderBaseshouldSkipAsRTLVariantto accept configurable active values parameterAdditional notes
nildefaults to["On"], matching previous behaviorvalidateRTLValuesandvalidValues(for:)are internal for direct unit testing without network mocks