[vue3.x] Global types break volar and vue-tsc
Blackfaded opened this issue · 5 comments
Blackfaded commented
Describe the bug
global.d.ts code breaks volar and vue-tsc
Additional context
This codeblocks breaks volar and vue-tsc.
declare global {
namespace JSX {
// tslint:disable no-empty-interface
interface Element extends VNode {}
// tslint:disable no-empty-interface
interface ElementClass extends Vue {}
interface IntrinsicElements {
'vue-slider-dot': any
'vue-slider-mark': any
div: any
span: any
input: any
template: any
}
}
}
Every component is any when the global JSX namespace is overridden.
If I remove this codeblock volar and vue-tsc will work again.
If its for dev purposes only maybe you could just remove it from the npm bundle?
A workaround for now is the following
"postinstall": "rimraf node_modules/vue-slider-component/lib/typings/global.d.ts"
Environment (If you feel unrelated, please delete the block)
- OS & Version: macOS
- Vue version: 3.2.37
- Component Version: 4.1.0-beta.1
- vue-tsc: 0.38.8
NightCatSama commented
duplicate #544
NightCatSama commented
try add skipLibCheck: true
to tsconfig.json
Blackfaded commented
Thanks for your reply.
I had this flag present and the error still occurred.
NightCatSama commented
I have modified the type file, you can try installing the latest version 4.1.0-beta.2
.
Blackfaded commented
Yes, this works! Thank you very much!