New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New] jsx-no-leaked-render
: add ignoreAttributes
option
#3441
base: master
Are you sure you want to change the base?
Conversation
When true, validation of JSX attribute values is skipped.
Codecov Report
@@ Coverage Diff @@
## master #3441 +/- ##
==========================================
- Coverage 97.62% 97.61% -0.01%
==========================================
Files 123 123
Lines 8959 8970 +11
Branches 3272 3275 +3
==========================================
+ Hits 8746 8756 +10
- Misses 213 214 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on the use case here?
Certainly the component you're passing the prop value to might not be directly rendering it - but I'm not sure why that makes it OK to pass a renderable falsy value.
The use case is preferring to avoid false positives. The component receiving the prop is responsible for avoiding leaky render. Many prefer to keep the warning local to where the prop is actually rendered. |
I see - so you're saying, you still want to report on leaky renders on DOM elements, but you don't want to do that on props on custom elements so that the custom component has the responsibility to check for it? In that case, what i'd expect is that this could be |
59af733
to
865ed16
Compare
069314a
to
181c68f
Compare
This rule is unusable to me until this PR is landed. I need to handle a very basic usecase of |
Fixes #3292
When
ignoreAttributes
is true, validation of JSX attribute values is skipped.Todo