Open MaxVanDeursen opened 5 months ago
This is an expected error, the tsconfig exclude option does not prevent checking of referenced files, see https://stackoverflow.com/a/64885126.
The presence or absence of Empty.vue
causing inconsistencies is an edge case. Errors in App.vue
will only be found when global types are generated, but since global types will only be generated from .vue
files included in tsconfig, App.vue
will only report it when tsconfig includes more than one .vue file.
To ignore errors in App.vue
, you may consider using @vue-ignore
/ @vue-skip
instead.
<template>
<!-- @vue-ignore -->
<button :type="3"></button>
</template>
@johnsoncodehk Thank you for your explanation regarding the tsconfig exclude option and for a solution to my problem. I have opted for the <!-- @vue-ignore -->
annotation, successfully ignoring the type warning and resulting in a successful vue-tsc
run.
Is the difference in behaviour between the versions 2.0.7 and 2.0.11 worth investigating, leaving this issue relevant? Feel free to close this issue if this is not the case.
Information
Package + version: vue-tsc@2.0.11 Previous package + version used: vue-tsc@2.0.7 Scenario: I have a Vue component within which I have Typescript errors. I have excluded this specific file through the
tsconfig.json
'sexclude
configuration. Using version2.0.7
, this worked as expected, where the errors did not trigger any while usingvue-tsc
. Updating to version2.0.11
appears to ignore the aforementioned exclusion. The result of this is that this error now shows up when runningvue-tsc
.Reproduction
Steps:
npx vue-tsc
. Note that the version ofvue-tsc
is2.0.7
. Note that the command does not output any errors.vue-tsc
to2.0.11
, e.g. through runningnpm i vue-tsc@2.0.11 --save-dev
npx vue-tsc
again.Expected: As the error is in
src/App.vue
, and this file is excluded from type checking withintsconfig.json
, no errors are raised, as is previously the case.Actual: An error is raised due to the error within![image](https://github.com/vuejs/language-tools/assets/15815926/9fe7806a-7330-4b42-8314-f35f54fe818d)
src/App.vue
:Removing the empty
Empty.vue
file results in theApp.vue
being successfully ignored from type checking.