-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3441 +/- ##
==========================================
- Coverage 97.71% 97.65% -0.06%
==========================================
Files 133 136 +3
Lines 9958 9981 +23
Branches 3693 3696 +3
==========================================
+ Hits 9730 9747 +17
- Misses 228 234 +6 ☔ View full report in Codecov by Sentry. |
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 |
I want to know how to use the ignoreAttributes option?
Is there a use case that i can refer to? |
@l1135677068 this PR isn't merged yet, and thus can't be released yet either, so you can't use it yet. |
I've just rebased this PR; it's ready to go once there's documentation. If someone wants to leave a code review suggestion, I can pull it in and land this. |
ok, i get it. |
380e32c
to
51d342b
Compare
I think considering this PR has been open for 2 years without movement from the author (who is active), it's potentially safe to say they have higher priorities at this time. I would suggest to get this past the finish line, by someone championing it and picking up where the original author left off. Fork his fork, make the necessary documentation changes, and create a separate pull request, and mention this one. @artemxknpv you wrote a documentation change suggestion, maybe you'd like to take this on? It's so close, and it's crazy to me that 2 years have passed on this and all it required were some documentation updates. I would also suggest that |
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.
Seems pretty good.
ab154a4
to
ef74762
Compare
I agree with the use of |
Fixes #3292
When
ignoreAttributes
is true, validation of JSX attribute values is skipped.Todo