Skip to content
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

not support tsx? #140

Open
wuguojun1006 opened this issue Jul 22, 2021 · 3 comments
Open

not support tsx? #140

wuguojun1006 opened this issue Jul 22, 2021 · 3 comments

Comments

@wuguojun1006
Copy link

image
image

why?????

@skotchpine
Copy link

@wuguojun1006 the current workaround is to add a side effect that uses every import. Something as simple and ugly as:

import x; x

If I remember correctly, the problem is that tsc strips unused variables before the pug is transformed.

There are other issues here that have more explanation and discussion. You can search to find more infos.

Im about to start a library like this, but with the lit approach, so that tsc works the way we need. I’ll ping you when it’s up.

@ezhlobo
Copy link
Member

ezhlobo commented Jul 30, 2021

@skotchpine I'm happy to see that you are working on a separate solution similar to this. I'd also be happy to participate in any discussions or contribute to the solution.

I also think of refactoring this library, however I don't have many ideas to make it work with tsc, so it would be great tto collaborate on that :).

@StackTrac3
Copy link

StackTrac3 commented Aug 14, 2021

the current workaround is to add a side effect that uses every import. Something as simple and ugly as:

import x; x

This should be in the documentation. Being ugly is no excuse for hiding a crucial workaround in the GitHub issues.

Check out react/jsx-uses-vars

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

No branches or pull requests

4 participants