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]: Functional components first letter capitalization check #2699

Merged

Conversation

jzabala
Copy link
Contributor

@jzabala jzabala commented Jul 6, 2020

As stated by @ljharb in #2554 (comment), functions starting with a lowercase letter are not components.

This PR adds a check for the capitalization of the first letter in functional components detection.

With this change all the reported cases in the issue work properly.

Fixes #2554. Fixes #2495. Fixes #2607. Fixes #2352. Fixes #2325. Fixes #1919.

…st letter capitalization in functional component detection

Fixes jsx-eslint#2554. Fixes jsx-eslint#2495. Fixes jsx-eslint#2607. Fixes jsx-eslint#2352.
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would you mind adding some test cases to various rules?

@jzabala
Copy link
Contributor Author

jzabala commented Jul 8, 2020

Thanks! Would you mind adding some test cases to various rules?

Thanks for your review @ljharb. I added some tests based on the issues this PR solves.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give this another few hours in case it turns out to fix even more old issues ;-)

@ljharb
Copy link
Member

ljharb commented Jul 28, 2020

This may have caused #2728.

@jzabala jzabala deleted the fix/improve-functional-component-detection branch July 28, 2020 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment