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

Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Use 'verbatimModuleSyntax' instead. #6599

Closed
1 task
artursopelnik opened this issue Mar 20, 2023 · 5 comments · Fixed by #6605

Comments

@artursopelnik
Copy link

What version of astro are you using?

16.12.0

Are you using an SSR adapter? If so, which one?

none

What package manager are you using?

any

What operating system are you using?

any

What browser are you using?

any

Describe the Bug

Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Use 'verbatimModuleSyntax' instead.

See here:
https://github.com/withastro/astro/blob/main/packages/astro/tsconfigs/strict.json

Link to Minimal Reproducible Example

https://github.com/withastro/astro/blob/main/packages/astro/tsconfigs/strict.json

Participation

  • I am willing to submit a pull request for this issue.
@Princesseuh
Copy link
Member

We can't change this until a majority of our users are on TypeScript 5.0, since we don't control the TypeScript version used. Even VS Code does not have TypeScript 5.0 at the moment.

We'll add ignoreDeprecations: "5.0" to our templates in the meantime

@MrHBS
Copy link

MrHBS commented Apr 26, 2023

@Princesseuh FWIW VSCode shipped with TS 5.0 on the March release. Do you think it is time to bump TS?

@Princesseuh
Copy link
Member

I'm thinking of waiting a bit more, because changing it to verbatimModuleSyntax is breaking unfortunately. For what it's worth, you can still use the option yourself, we just can't include it in our templates.

@MrHBS
Copy link

MrHBS commented Apr 26, 2023

How long is a bit more lol? Perhaps after the 5.1 release next month?

@Princesseuh
Copy link
Member

Princesseuh commented Apr 26, 2023

Optimally, we should unfortunately be waiting on either Astro's 3.0 or TS's 5.5 to make sure we don't break people, which might be months away still 😔 Nonetheless, we'll consider it after 5.1, hopefully most people wouldn't be too affected by then.

It's a bit of a frustrating situation, just having verbatimModuleSyntax in your tsconfig.json prevent compilation when using 4.9 TS or lower. I wish it would've been possible to just add it and for TS to ignore importsNotUsedAsValues when verbatimModuleSyntax is present, alas.

Again though, just in case for anyone reading: Nothing prevents you from using TypeScript 5.0+ and its cool options in Astro today, this issue only affect our templates.

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 a pull request may close this issue.

3 participants