-
Notifications
You must be signed in to change notification settings - Fork 21
Disable jsx plugin for .ts files #75
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
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 the PR, looks good to me 👍 just a few minor comments
@gregoryzh do you have anything you want to add? Since #72 is similar to this PR, let's work together on one. |
sure, |
Good catch. I had one, but must have accidentally removed it. Added. |
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.
nice, thanks @ehaynes99 and @gregoryzh !!
The JSX plugin for Typescript is not compatible with bracket-style type assertions. This led to the introduction of the
as
keyword as an alternate:https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-6.html#new-tsx-file-extension-and-as-operator
This restricts the plugin to only be used with
.tsx
files.NOTE: There was a copy/paste error in the babel parser test that was skipping over the existing JSX test. Since other tests in the same file were using a comparison of the whole object that precludes such omissions, I changed the style of 2 of the tests to be consistent with this.