[No QA] fix: improve CLEAN-REACT-PATTERNS-* rules detection#82443
Merged
mountiny merged 6 commits intoExpensify:mainfrom Feb 19, 2026
Merged
Conversation
VickyStash
reviewed
Feb 16, 2026
Contributor
|
I'd also ensure these rules apply to hooks - see this discussion for reference. Right now they only cover components |
…rule - Broaden Case 1 search patterns to should\w+ and can\w+ (VickyStash) - Generalize Case 1 condition to reference search patterns (VickyStash) - Remove onChange from Case 3 monolithic prop example (VickyStash) - Add DO NOT flag for thin platform primitive wrappers (TMisiukiewicz) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
002c915 to
8b1c388
Compare
Explicitly note that booleans selecting between layout/styling strategies on focused components (e.g., shouldUseAspectRatio) fall under the existing presentational prop exception and should not be flagged as composition-over-configuration violations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds detection for statically-known items encoded as data arrays and .map()'d through generic components — a pattern missed during PR Expensify#80829 review. Includes incorrect/correct examples, review metadata conditions, DO NOT flag exceptions for runtime data and list components, and search patterns. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ReactNode slot props as Case 2 variant (leftComponent, rightComponent, etc.) - Add Case 5: render function props (renderTitle, renderSubtitle, etc.) - Add correct examples: compound component slots, Suspense over isLoading - Fix Case 2 detection step 4: test "only for conditional rendering" not "only one place" - Close Case 4 cosmetic compliance loophole (compound components inside .map) - Replace Case 3 numeric threshold with qualitative guideline - Add DO NOT flag exceptions for children, list callbacks, per-item runtime data - Add search patterns for Case 5 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Render helpers (renderContent, renderTodoItems, etc.) are a single-responsibility violation — they hide the render tree and prevent React Compiler memoization. Added incorrect example, detection conditions, exceptions, and search patterns. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
…in CLEAN-REACT-PATTERNS-1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
@adhorodyski Seems like you already tested this with bunch of PRs, did you want to do any more tests? |
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
mountiny
approved these changes
Feb 19, 2026
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
41 tasks
Contributor
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.23-2 🚀
|
Contributor
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.23-3 🚀
|
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.
Explanation of Change
CLEAN-REACT-PATTERNS-1(Composition over Configuration): Restructured search patterns to be per-case, broadened boolean prop detection (should\w+, can\w+), added new cases for config-array driven rendering (Case 4), render function props (Case 5), and ReactNode slot props (Case 6). Also closes loopholes, clarifies the presentational prop exception, and adds DO NOT flag exceptions for thin platform wrappers, children, list callbacks, and runtime data.CLEAN-REACT-PATTERNS-4(No Side-Effect Spaghetti): Added detection for internal render helpers (renderContent, renderTodoItems, etc.) as single-responsibility violations that hide the render tree and prevent React Compiler memoization.Tested against:
#82229
#80829
#81058
#80974
#80931
#80951
Fixed Issues
$ #74367
PROPOSAL:
Tests
code-inline-reviewer (agent)against any PR and report you back violations.Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari