Since Vite is not able to recognize Typescript errors, I want the Vite-plugin-checker to check them for me while developing. Following the documentation, I installed as dev dependency:
"vite-plugin-checker": "^0.5.6",
"vue-tsc": "^1.2.0"
"typescript": "^5.0.3",
Then, in my vite.config.ts, I use the plugin:
import checker from 'vite-plugin-checker'
plugins: [
vue(),
checker({typescript: true, vueTsc: true})
]
But when I run the application, it doesn't recognize any error. If I run it in build mode, it does. What's the problem here?
If any one still stuck on this issue, I could resolve it by adding the path to tsconfig like below.
checker({
vueTsc: {
tsconfigPath: './tsconfig.app.json',
},
}),
Below are some useful commands to check this issue to see the files are listened by the vue-tsc
npx vue-tsc --noEmit -p tsconfig.app.json --diagnostics
npx vue-tsc --noEmit --diagnostics
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With