-
Notifications
You must be signed in to change notification settings - Fork 150
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
Feature: type-checking #205
Comments
|
@kaisermann Why you just closed the issue? |
@sharifzadesina From a user perspective, I understand your nuisance. However, type-checking all of a Svelte component's code is not as trivial as it is with React components or with simple TypeScript files. We consciously decided to not type-check from However, there have been a significative amount of folks asking why we don't throw an error if a type error is found. Following the rest of the optional features of this library, maybe we can use the I'll reopen this as this could be easily done, but I should note that, performance-wise, this is not an optimal solution, as we'd be going over a component's code twice: |
@kaisermann bro I understand what you're saying, but while all standard TS tools do it, and they don't have any problem, why we shouldn't do it? some people use Notepad for developing, why we have to force them to use VSCode? or to run a CLI command each time? (I know they can use some kind of hook, but it is still a dirty solution). |
Another approach would be to just add a watch-mode to |
If we do this inside
|
The more I think about it the more I feel like
|
@dummdidumm Hi, I just checked Nuxt.js (It is for Vue.js) |
TypeScript is all about finding errors at build time so i expect a TypeScript preprocessor to also throw these errors at build time. |
A preprocessor only gets the content of the <script lang="ts">
let a: number = 1;
</script>
{a}
So there simply is no good way to make this part of the preprocessors. To get TS errors at build time, just use |
Maybe this could be integrated as a kind of post-processing step then? Right now this breaks expectations and complicates things. I already have a webpack build on watch (actually 2, server & client) and ideally that would just show me the errors without the need to run another watcher in parallel. |
I agree that there are ways to make this easier / feel more built-in, but |
I'm on @dummdidumm's side here. Will close this in favor of issues in |
Hi,
Unlike ts-loader, svelte-preprocess doesn't respect
noEmitOnError
compiler option, it seems right now we only report syntax errors and we ignore all other errors.like if you do this:
You will get no error.
But for normal Typescript files ts-loader, will report the error and will prevent files to be compiled.
The text was updated successfully, but these errors were encountered: