lit-analyzer icon indicating copy to clipboard operation
lit-analyzer copied to clipboard

Add proper event types for @ notation

Open Kokujou opened this issue 3 years ago • 1 comments

Hi guys. i really want to set the "noImplicitAny" flag in my JSConfig, but in order to do that, i desperately need types to @-events. for addEventListener it already works splendid but in the @-notation the event parameter is still the any-type.

of course you can simply not add the anonymous function notation ( (e)=>{...} ) and instead bind your event by name like @click="${this._handleClick}", but this only works if you have no additional parameters, which is very likely.

the other way to prevent it is to have inline JSDoc notation but... you might agree that it's very ugly to have a JSDoc comment for a basically redundant type in the midst of your HTML code

please consider fixing this.

Kokujou avatar Jul 20 '22 09:07 Kokujou

push? attention please? i know it's an annoying issue but it's a frequent error source if you can't properly detect the type of events, especially of custom events. you have the correct type from the dispatch event source, tehre must be a possibility to properly parse it and match those two types together.

Kokujou avatar Sep 12 '22 13:09 Kokujou