feat: add no-inline-object-props performance rule#30
Open
theakshaymore wants to merge 1 commit intomillionco:mainfrom
Open
feat: add no-inline-object-props performance rule#30theakshaymore wants to merge 1 commit intomillionco:mainfrom
theakshaymore wants to merge 1 commit intomillionco:mainfrom
Conversation
Detects inline object/array literals passed directly as JSX props which create new references on every render causing unnecessary re-renders. - Added rule visitor in performance.ts - Registered in index.ts - Added severity (warn) in oxlint-config.ts - Added category mapping and help text in run-oxlint.ts - Added test coverage in run-oxlint.test.ts
|
@theakshaymore is attempting to deploy a commit to the Million Team on Vercel. A member of the Team first needs to authorize it. |
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
Adds a new performance rule
no-inline-object-propsthat detects inline object and array literals passed directly as JSX props.Problem
When objects or arrays are created inline as JSX props, a new reference is created on every render. This causes unnecessary re-renders of child components even when the actual data hasn't changed — a common and silent React performance issue.
Example
❌ Bad — new reference created on every render
✅ Good — stable reference, no unnecessary re-renders
Changes
performance.tsindex.tswarn) inoxlint-config.tsrun-oxlint.tsrun-oxlint.test.tsValidation
pnpm --filter react-doctor test)