-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
propName should always return a value #50
propName should always return a value #50
Conversation
33e581a
to
f520208
Compare
7e29e3c
to
e89722b
Compare
Ya, the coverage fall is fine. I removed a test that doesn't test anything. |
} | ||
|
||
return prop.name.name; |
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.
This could cause upstream failures if prop.name
is undefined. Do we want to keep the switch statement and return an empty string, or do you think it's ok for an error to be thrown (i'm indifferent, its an edge case)
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'm in agreement with @ljharb here. A JSXAttribute without a name seems very unlikely.
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.
sounds good to me
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.
If it can exist, then we should have a test case for it. Lacking one, we shouldn't expect it to exist :-)
@evcohen I don't have write access to this repo. Merge is all yours. |
Currently, the return value of
propName
is nullable. It should be able to guarantee a return value all the time.