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

chore: move typescript to svelte-check's peer dependency #1860

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Andarist
Copy link

@Andarist Andarist commented Feb 9, 2023

It is kinda debatable but I feel that it's better to use the installed version of typescript. I just had to go through a surprising debugging session since my IDE was using TypeScript 4.8 but svelte-check was using TypeScript 4.5 (I had an old version that had the * range declared on typescript and TS 4.5 was left in the lockfile from before the rest of the monorepo bumped TS to TS 4.8.

I understand that this might create a different problem though - now the svelte-check might run with a different version of TS than the VS Code extension. However, this isn't a new problem - it already exists.

@dummdidumm
Copy link
Member

I'm very hesitant to merge this. Having it as a peer dependency allows us to make use of new TypeScript constructs without having to release a major version svelte-check. It doesn't happen often but it did before.

@Andarist
Copy link
Author

Andarist commented Feb 9, 2023

From my PoV it's important to consider user expectations here.

Scenario 1:

  1. I upgrade my project to TS 5.0 (the version itself doesn't really matter, it's just an example) and I start using const type parameters
  2. Can I expect svelte-check to handle this new syntax? And this isn't even about new syntax - any TS version can change the type checking behavior. Is it expected that I don't get any errors when running tsc or in the IDE (in my regular TS files) or is it expected that I can run into problems here? Is this caveat communicated in the docs anyhow?

Scenario 2:

  1. I upgrade svelte-check and it starts using TS 5.0 with its more strict relational operators
  2. Is it expected that I start getting new errors for the existing code only when running through svelte-check?

without having to release a major version svelte-check

What's the problem with new major versions though? They are honest and convey the intent nicely. It's just like an age - it's just a number 😉

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

Successfully merging this pull request may close these issues.

None yet

2 participants