Describe the bug
I have this component:
<script lang="ts">
export let one = false;
export let disabled = false;
export let two = false;
export let three = "";
export let four = false;
export let fivefive = false;
</script>
<div {disabled}>Hello!</div>
if I use svelte2dts to create it's declaration types it works but I have this error using it:
Argument of type 'string' is not assignable to parameter of type 'never'. ts(2345)

If instead I rename this line:
- export let fivefive = false;
+ export let five = false;
it works! It's crazy! I know!

I think svelte2dts is using svelte2tsx for conversion, right?
To Reproduce
Component REPO: https://github.com/frederikhors/svslte2tsx-issue-on-never
- clone it
- npm install
- npm run build
- npm link
- cd your svelte ts project
- npm link svslte2tsx-issue-on-never
- use it like below
- open VSCode
- TADA the problem!
Use it like this:
<Test on:click={() => window.location.reload()}>Reload</Test>
Expected behavior
I do not understand with in the first case this is what I got in VSCode for on:
(method) Svelte2TsxComponent<{ one?: boolean; disabled?: boolean; two?: boolean; three?: string; four?: boolean; fivefive?: boolean; }, {}, {}>.$on<never>(event: never, handler: (e: never) => any): () => void
and in the second case I get:
(method) Svelte2TsxComponent<{ one?: boolean; disabled?: boolean; two?: boolean; three?: string; four?: boolean; five?: boolean; }, { [evt: string]: CustomEvent<any>; }, {}>.$on<"click">(event: "click", handler: (e: CustomEvent<any>) => any): () => void
System (please complete the following information):
svelte2dts through svelte2tsxYes, svelte2dts uses svelte2tsx. I have to check why this would make a difference. It should throw a type error in both cases because you don't forward the click event in Test.svelte, on:click will therefore never fire.
Most helpful comment
Yes,
svelte2dtsusessvelte2tsx. I have to check why this would make a difference. It should throw a type error in both cases because you don't forward theclickevent inTest.svelte,on:clickwill therefore never fire.