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

False positive for react/display-name #3289

Closed
veloek opened this issue May 19, 2022 · 5 comments · Fixed by #3291
Closed

False positive for react/display-name #3289

veloek opened this issue May 19, 2022 · 5 comments · Fixed by #3291

Comments

@veloek
Copy link

veloek commented May 19, 2022

There seems to be a regression in version 7.30.0. Functions like these are now treated like components and trigger the react/display-name rule:

export const demo = (a?: string) => (b?: string) => {
    if (a == null) return null;
    return b;
}

I understand that it might be hard to separate function components from regular functions, but aren't React components always capitalized? Couldn't that be a way to identify them?

This wasn't a problem in version 7.29.4 of eslint-plugin-react.

eslint@8.15.0
eslint-plugin-react@7.30.0

@dottorblaster
Copy link

Plus one. You can see the example here. https://github.com/trento-project/web/runs/6502507233

@ljharb
Copy link
Member

ljharb commented May 19, 2022

cc @golopot; perhaps some of your refactors broke this?

@golopot
Copy link
Contributor

golopot commented May 20, 2022

Yes PR #3276 broke this.

@GuillaumeAmat
Copy link

Friendly question: Do you plan to make a new release in the coming days?

cc @golopot @ljharb

@ljharb
Copy link
Member

ljharb commented May 24, 2022

@GuillaumeAmat i don't have any specific plans for any release. There will be a release when it's ready.

jgerigmeyer added a commit to oddbird/Metecho that referenced this issue May 24, 2022
* main:
  Do not upgrade eslint-plugin-react yet: jsx-eslint/eslint-plugin-react#3289
  Automated dependency upgrades
jgerigmeyer added a commit to oddbird/Metecho that referenced this issue May 27, 2022
* main:
  Do not upgrade eslint-plugin-react yet: jsx-eslint/eslint-plugin-react#3289
  Automated dependency upgrades
  line nested checkboxes with with labels
  fix nested accordion padding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

5 participants