-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Svelte's tooling ignores TypeScript code from previous preprocessors
#1567
Comments
This is primarily a duplicate of #339 although that one is specific about template preprocess, the limitation we have still applied. The type check step doesn't use the preprocess config. It could also be argued that even if we were to fix that issue. The script preprocesses would probably still be ignored. Currently, There's no way to tell if the preprocess is intended for type checks. And we can't run all the preprocessing as the code will not be typescript anymore. |
Thanks, I now understand the problem better. The issue you have linked (#339) is about making an asynchronous process synchronous. So I think those are two different problems that can be solved independently, right? |
Description
Speaking of the VS Code extension and the
svelte-check
command, when I'm adding my own preprocessor that modifies the script tag to include additionalTypeScript
syntax, that part gets ignored by the tooling.I tried
svelte-check
and added some debug logs to see if the custom preprocessor get's loaded. The logs show up, but If I'm adding TypeScript syntax, the tooling ignores it.Not sure what exactly happens, but it seems that the last preprocessor doesn't use the full output from the previous preprocessors.
Proposed solution
The VS Code extension and
svelte-check
should take the input from the previous preprocessors.Alternatives
Leave it like it is and don't allow custom use-cases.
Additional Information, eg. Screenshots
Here is my
svelte.config.js
fileThe first preprocessor will add the generated type imports for the
Load
function.The second preprocessor checks if the first preprocessor modified the source code
The third preprocessor is the usual
svelte-preprocess
that ccan handleTypeScript
syntaxHere is my custom route
routes/test/[id]/summary
:When running
svelte-check
I get following error:As you can see my custom preprocessor gets executed, but in the end I still see an error because the type import for
Load
is missing.The text was updated successfully, but these errors were encountered: