Skip to content

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

Merged
merged 8 commits into from
Jun 9, 2021
Merged

Disable jsx plugin for .ts files #75

merged 8 commits into from
Jun 9, 2021

Conversation

ehaynes99
Copy link
Contributor

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.

Copy link
Collaborator

@connectdotz connectdotz left a 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

@connectdotz
Copy link
Collaborator

@gregoryzh do you have anything you want to add? Since #72 is similar to this PR, let's work together on one.

@gregoryzh
Copy link

gregoryzh commented Jun 7, 2021

@gregoryzh do you have anything you want to add? Since #72 is similar to this PR, let's work together on one.

sure,
One thing, since we are solving the Agular bracket issue for ts. @ehaynes99 can you add a test case for that?

@ehaynes99
Copy link
Contributor Author

Good catch. I had one, but must have accidentally removed it. Added.

Copy link
Collaborator

@connectdotz connectdotz left a 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 !!

@connectdotz connectdotz merged commit 40943f3 into jest-community:master Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants