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
For typescript, retry without jsx plugin in case of error #807
base: main
Are you sure you want to change the base?
Conversation
I've seen a lot of React code in the wild that use .ts for their components, wouldn't this break depcheck for all of these users? |
@rumpl You're probably right, if that's the case then I have an alternative approach to propose. We can first parse with the jsx plugin activated. And if we get an exception, we can then try to parse without the jsx plugin. |
Sounds good to me! |
@znarf What was the rationale for this PR though? Are there cases where the parser with the jsx plugin would fail to parse a valid typescript file? |
In my codebase at https://github.com/opencollective/opencollective-api, I get the following errors when the
|
Oooh, it's because of things like this |
It's valid but not compatible with jsx and there is no point updating the syntax on our side, it's a server side project. Some related discussion: microsoft/playwright#21462 So, we need a way to skip jsx in projects that don't expect it. Or use the latest approach that I submitted, retry without jsx if there is an error. |
Experience the same thing rgith now, the jsx parsing fails silently and therefore depcheck reports issues that are non existing.
removing jsx check, solves it. what is blokcing this PR? :) we are working around with tit by using a custom patch, but less than ideal. Furthermore we have another isuse, the babel/parser that is used is fixed to 7.16.4, which does not support e.g. satisfies operator. the patch we are using:
|
69e44f7
to
39ffb3d
Compare
Would be great to merge that or the similar solution proposed at #849 |
No description provided.