Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.

Support *.tsx #4

Closed
Wildhoney opened this issue Nov 14, 2017 · 3 comments
Closed

Support *.tsx #4

Wildhoney opened this issue Nov 14, 2017 · 3 comments
Labels

Comments

@Wildhoney
Copy link

Wildhoney commented Nov 14, 2017

Although *.ts files seem to run perfectly well, I'm having trouble getting *.tsx files to be recognised.

With ava-ts **/*.test.{ts,tsx} it claims it cannot find any *.tsx files, but finds an abundance of *.ts files and runs them successfully. I've tried renaming my .tsx files to .ts, and although ava-ts then finds them, it fails to compile — potentially because they now have an incorrect extension, or it may be an additional issue to resolve.

Do you have any examples of how to add support for .tsx?

@andywer
Copy link
Owner

andywer commented Nov 15, 2017

Hey @Wildhoney!

#1 introduced the changes in file name matching. We could just add *.tsx in all the necessary places.

To be fair - AVA does not seem to match *.jsx either. I would rather suggest renaming to *.ts, since renaming the file the moment you add the first bit of JSX or removing the only JSX snippet sucks. But this is just my personal opinion 😉

I am pretty sure there is something else wrong if it didn't work with the renamed files either. Maybe you can provide an example?

@Wildhoney
Copy link
Author

Wildhoney commented Nov 15, 2017

I'm not a huge fan of TS, and I totally agree with you regarding the renaming from .ts to .tsx. In projects that I setup and manage, I have all of the JSX in .js files. However unfortunately this isn't my project.

I will investigate further today, and update the ticket if I find anything.

I assume it is possible to use JSX in a .ts file? In the TS docs it claims that it's wanting a .tsx extension, so I don't know how well baked into TS that convention is.

DannyRyman added a commit to DannyRyman/ava-ts that referenced this issue Feb 2, 2018
@andywer andywer closed this as completed in #9 Feb 4, 2018
@andywer
Copy link
Owner

andywer commented Feb 4, 2018

Fixed in v0.24.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants