-
Notifications
You must be signed in to change notification settings - Fork 434
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
Consider flipping order of tsconfig.app.json
and tsconfig.vitest.json
in tsconfig.json
and enabling "vue.server.reverseConfigFilePriority": true
#264
Comments
Good idea! I didn't know such an option existed. |
Also about the order issue, I found that revising I previously tried that to change that property and it is not working until I move it from |
I'm trying to wrap my head around all these tsconfigs, and write some docs for the setup. Could someone help me understand why the order might matter? I'd thought it was because the settings would overwrite each other, but now I'm seeing that references should be isolated in scope, so the order shouldn't actually matter? |
The vitest one also seems to include the normal sources, and the order of which one is selected for a file that is included in more than one referenced tsconfig is flipped between tsserver and vue files handled by volar. This can be observed in the VS Code status bar, whose tooltip tells you which tsconfig is being used for the current file. |
@segevfiner Thank you! Folding that into my docs. But won't flipping the order affect vue-tsc, too? Why is it only Volar that needs the option changed? |
vue-tsc is either using a single tsconfig.json that is passed to it on the CLI or by looking for the default Volar is using the tsserver which has its own logic to figure out the right tsconfig.json based on the default |
With:
Instead of:
And enabling
"vue.server.reverseConfigFilePriority": true
, Volar and the builtin TypeScript integration of VS Code correctly selecttsconfig.app.json
for Vue & TS files, andtsconfig.vitest.json
for test files, otherwise the order is a bit messed up and you sometimes gettsconfig.vitest.json
for non-test Vue & TS files.The text was updated successfully, but these errors were encountered: