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] boolean-prop-naming: avoid a crash with a non-TSTypeReference type #3718

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

developer-bandi
Copy link
Contributor

related #3717

I think cause of bug is no concider below case

type Props = {
  enabled: boolean
}
        
const Hello = (props: Props & {
  semi: boolean
}) => <div />;

To explain in detail, if the type is not TSTypeReference (literal type, etc.), a reference error appears to have occurred because there is no typeName property.

Therefore, if it is not the corresponding type, the type has been modified to be used as is rather than taken from objectTypeAnnotations.

Copy link

codecov bot commented Mar 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.71%. Comparing base (eea45bf) to head (4467db5).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3718      +/-   ##
==========================================
- Coverage   97.76%   97.71%   -0.05%     
==========================================
  Files         133      133              
  Lines        9467     9470       +3     
  Branches     3467     3469       +2     
==========================================
- Hits         9255     9254       -1     
- Misses        212      216       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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!

@ljharb ljharb changed the title [Fix] boolean-prop-naming: TSIntersectionType with TSTypeReference And TSLiteral reference Error [Fix] boolean-prop-naming: avoid a crash with a non-TSTypeReference type Apr 11, 2024
@ljharb ljharb merged commit 4467db5 into jsx-eslint:master Apr 11, 2024
308 of 309 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants