marko-js / language-server

Marko autocomplete, intellisense and editor support.
MIT License
37 stars 8 forks source link

Incorrect Typescript generation on Tags API Preview with return values #250

Closed vwong closed 2 months ago

vwong commented 6 months ago

@marko/type-check@1.0.7 and above

Details

When using the Tags API Preview (0.7.2), return values of HTML elements cause type exceptions.

For example,

<!-- use tags -->
<div/foo/>

Causes the following error when running mtc

Property 'value' does not exist on type '() => HTMLDivElement'.

Expected Behavior

No Typescript errors are raised.

Actual Behavior

Typescript errors prevent CI from passing. Pinning to @marko/type-check@1.0.6 works for now with no changes to the code.

Your Environment

Mac OS 13.6.3 NodeJS 20.10.0

vwong commented 4 months ago

This is still happening with @marko/type-check@1.17 and all the latest Marko packages as of today.

Also this does not happen with custom tags, only native HTML tags. Ie, the following is ok:

<my-custom-tag/foo/>

For now, I'm pinning to @marko/type-check@1.0.6

vwong commented 2 months ago

Thanks!