Open ptu14 opened 1 year ago
Hi, this is not only connected to role property. This seems to be a problem with all ariamixin related attributes, eg:
FWIW this also appears to be true for all input, select, etc types from lib.dom.d.ts
- for instance, a similar error will be reported when using:
const value: "hidden" | "text" = "hidden";
html`<input
type={value as HTMLInputElement["type"]}
/>
This makes it quite hard to get both lit analyzer and typescript types passing on projects that use both.
Hi, I'm wondering why
lit-analyzer
thatts-lit-plugin
using, uses type definitions fromvscode-html-languageservice
rather thantypescript
lib.dom or own type definitions.For example
role
attribute case:When i create Lit component with native input inside:
lit-plugin in vscode and in Intellij highlight this as type error
when i run
npx lit-analyzer
i get
but inside
typescript/lib/lib.dom.d.ts
we haverole: string | null;
I understand that Lit doesn't always have a connection to TypeScript, but what it's doing now is also not accurate according to https://w3c.github.io/aria/#ARIAMixin. where type of
role
isDOMString
.maybe this bug should be reported to
ts-lit-plugin
, but from what I can see these projects are connected somehow.