When using vite-plugin-checker with a Vue2 + TypeScript setup (so using the vls option), and customizing the vls option, the invocation of vti diagnostics in build mode is wrong, as the JSON.stringify-ed version of the option are just passed to vti diagnostics as an argument, but vti diagnostics does not support this style of option passing, and just appends the string to the workspace path. This then results in vti not type checking anything, since it can't find any files in that path.
transforming (1) index.html====================================
Getting Vetur diagnostics
Loading Vetur in workspace path: /Development/www/my-project/{"vetur":{"validation":{"templateProps":false,"style":false}}}
Vetur initialized
====================================
No input files
====================================
VTI found no error
✓ 113 modules transformed.
Note the line Loading Vetur in workspace path: /Development/www/my-project/{"vetur":{"validation":{"templateProps":false,"style":false}}}
Thus, any typescript errors in Vue components are not checked during build.
In dev mode, everything works fine, and typechecking is performed correctly.
The bug must have been introduced somewhere between 1.8.2 and 2.2.0
Reproduction
create setup with vite, vue2, typescript and vite-plugin-checker using vls/vti
add vls: {"vetur":{"validation":{"templateProps":false,"style":false}}} option to the plugin in vite.config.js
introduce a type error somewhere in a vue component
run vite build
no type error is detected
Expected behavior
When customizing the vls option according to the documentation, typechecking should still work in build mode!
Describe the bug
When using vite-plugin-checker with a Vue2 + TypeScript setup (so using the
vls
option), and customizing the vls option, the invocation ofvti diagnostics
in build mode is wrong, as the JSON.stringify-ed version of the option are just passed tovti diagnostics
as an argument, butvti diagnostics
does not support this style of option passing, and just appends the string to the workspace path. This then results invti
not type checking anything, since it can't find any files in that path.Output of
vite build
:Note the line
Loading Vetur in workspace path: /Development/www/my-project/{"vetur":{"validation":{"templateProps":false,"style":false}}}
Thus, any typescript errors in Vue components are not checked during build. In dev mode, everything works fine, and typechecking is performed correctly.
The bug must have been introduced somewhere between 1.8.2 and 2.2.0
Reproduction
vls: {"vetur":{"validation":{"templateProps":false,"style":false}}}
option to the plugin in vite.config.jsvite build
Expected behavior
When customizing the
vls
option according to the documentation, typechecking should still work in build mode!System Info
Additional context
No response
Validations