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
[Fix] display-name
: Get rid of false position on component detection
#2759
Conversation
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.
Thanks for opening this PR @iiison 🎉
tests/lib/rules/display-name.js
Outdated
title: "URL", | ||
dataIndex: "url", | ||
key: "url", | ||
render: url => ( |
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.
I don't think that under any conditions this function should be considered a component. Maybe if the name were uppercase, since that is a pattern I have seen in some libraries, something like:
<MyComponent.Button />
But not this way. What do you think @ljharb ?
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.
I thought of the same thing after your last comment on the issue :D
I am a little new to this codebase. could you please point me to the file/logic where we're classifying the code as a component?
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.
Sure, the main logic to detect components it at lib/util/Components.js
.
I have the feeling this bug is in the function getStatelessComponent
. You can start there. Hope it helps 🙂
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.
Yes, I agree. This shouldn't be a component.
Please unmark this as a draft when it's updated. |
display-name
: Get rid of false position on component detection
This also fixes #2758 |
Hey Guys, any news on this one? |
Codecov Report
@@ Coverage Diff @@
## master #2759 +/- ##
=======================================
Coverage 97.43% 97.43%
=======================================
Files 114 114
Lines 7536 7536
Branches 2750 2750
=======================================
Hits 7343 7343
Misses 193 193
Continue to review full report at Codecov.
|
Fixes #2751. Closes #2758.