Skip to content
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

merged 1 commit into from Sep 20, 2021


Copy link

@iiison iiison commented Aug 15, 2020

Fixes #2751. Closes #2758.

Copy link

@jzabala jzabala left a comment

Thanks for opening this PR @iiison 🎉

title: "URL",
dataIndex: "url",
key: "url",
render: url => (
Copy link

@jzabala jzabala Aug 19, 2020

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 ?

Copy link
Contributor Author

@iiison iiison Aug 20, 2020

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?

Copy link

@jzabala jzabala Aug 22, 2020

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 🙂

getStatelessComponent(node) {

Copy link

@ljharb ljharb Aug 30, 2020

Yes, I agree. This shouldn't be a component.

Copy link

@ljharb ljharb commented Aug 30, 2020

Please unmark this as a draft when it's updated.

@ljharb ljharb marked this pull request as draft Aug 30, 2020
@ljharb ljharb changed the title Fix 2751 [Fix] display-name: Get rid of false position on component detection Oct 15, 2020
Copy link

@k-yle k-yle commented Nov 28, 2020

This also fixes #2758

Copy link

@koengsen koengsen commented May 25, 2021

Hey Guys, any news on this one?

@ljharb ljharb marked this pull request as ready for review Sep 20, 2021
Copy link

@codecov-commenter codecov-commenter commented Sep 20, 2021

Codecov Report

Merging #2759 (9799131) into master (53a0d84) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2759   +/-   ##
  Coverage   97.43%   97.43%           
  Files         114      114           
  Lines        7536     7536           
  Branches     2750     2750           
  Hits         7343     7343           
  Misses        193      193           
Impacted Files Coverage Δ
lib/rules/display-name.js 98.11% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53a0d84...9799131. Read the comment docs.

@ljharb ljharb merged commit 9799131 into yannickcr:master Sep 20, 2021
123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants