NightCatSama/vue-slider-component

[vue3.x] Global types break volar and vue-tsc

Blackfaded opened this issue · 5 comments

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
    }
  }
}

Bildschirmfoto 2022-07-22 um 17 03 46

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

duplicate #544

try add skipLibCheck: true to tsconfig.json

Thanks for your reply.
I had this flag present and the error still occurred.

I have modified the type file, you can try installing the latest version 4.1.0-beta.2.

Yes, this works! Thank you very much!