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
fix(schema): add vueCompilerOptions property to TSConfig in defineNuxtConfig #25924
fix(schema): add vueCompilerOptions property to TSConfig in defineNuxtConfig #25924
Conversation
Run & review this pull request in StackBlitz Codeflow. |
726ab6e
to
88db8f2
Compare
@manniL Hi there! By the way, I must say I couldn't find any reference to these options anywhere but on Volar's changelog, so having those documented somewhere could be nice! Please let me know what you think βοΈ |
packages/schema/src/types/hooks.ts
Outdated
export type VueTSConfig = TSConfig & { | ||
vueCompilerOptions?: VueCompilerOptions; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user doesn't have this dependency installed, this (and mention above in schema) will be typed as any. We could use something like this type:
type IsAny<T> = 0 extends 1 & T ? true : false
to conditionally augment tsConfig only when VueCompilerOptions
is not any...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielroe changes made!
I've been pondering about it for some days now but I still don't quite understand one thing: how can the user not have the dependency installed if they're installing nuxt? π€
Also, why don't we need to make the same check for other dependencies as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user will only have this dependency installed if they add vue-tsc
. Nuxt doesn't ship with vue-tsc
by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see! Thank you π
8f14cfb
to
e6d2d72
Compare
e6d2d72
to
0cc2014
Compare
4c9e58b
to
c05fb60
Compare
Thank you β€οΈ |
π Linked issue
#25874
β Type of change
π Description
Resolves #25874
VueCompilerOptions
type added to thedefineNuxtConfig
schemaπ Checklist