Open becbaile-te opened 9 months ago
我遇到同样的问题 node_modules/vue-slider-component/lib/utils/control.ts:554:22 - error TS6133: 'pos' is declared but its value is never read.
554 dotsPos.forEach((pos,i) => {
src/views/schedule/components/addOrEditModal.vue:258:33 - error TS6133: 'rule' is declared but its value is never read.
Describe the bug
We are using this component in our design system library and ran into type errors in our own repo and in our consumer repos that we traced back to this line.
https://github.com/NightCatSama/vue-slider-component/blob/061e4f4afeb103d9727b58d1fabca486809472e7/lib/typings/index.d.ts#L78
In short, importing a Vue component in a
.d.ts
file did not allow that file to be excluded from type checking withvue-tsc
, and we saw errors like this one.In our library, we fixed this issue by overriding
index.d.ts
with our ownvue-slider-component.d.ts
file that exports the typeVue.ComponentOptions<Vue>
as the default export rather than the component itself. https://012.vuejs.org/api/options.htmlIn
tsconfig.json
:If this is an issue for anyone else, I would recommend updating this export in the
.d.ts
file to export a Vue component type rather than the component instance. Since this is a small change, I'm happy to open this PR if it is helpful.Environment (If you feel unrelated, please delete the block)