-
-
Notifications
You must be signed in to change notification settings - Fork 75
Breaking: switch 'jsx' option by filename (fixes #517) #543
Conversation
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.
Thanks for working on this! I have a few questions/concerns.
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.
LGTM, thanks!
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.
You don't need to let this block the PR, but my two cents would be that this option has outgrown its boolean type.
It would be far clearer to have an enum of possible strings:
jsx: 'disabled' | 'enabled' | 'auto'
Or something like that, where 'auto' or 'infer' or similar is the option that looks at your file extension. You could also provide fallback of false
being the same as 'disabled'
and true
being the same as 'enabled'
so as not to break anyone.
@JamesHenry Thank you for the review. The intention of this PR's spec is:
|
Ah I see, I get it now, thanks! |
Thanks for contributing! |
This PR makes the parser setting
jsx
option by filename automatically.*.ts
... it setsjsx: false
.*.tsx
... it setsjsx: true
.*.js
, not provided, etc...) ... respects the givenjsx
option.(Edited at
2018-11-08 20:52Z
)Fixes #517.