-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript error: "tagName" does not exist in type 'ClassDeclaration' #69
Comments
Same problem I ran into when updating the analyzer's implementation of this. It's because the custom element declaration interface is empty, while there's another unused interface containing what we want: custom-elements-manifest/schema.d.ts Line 185 in 2e391f2
There's an interface below that which feels like it was meant to be the custom element declaration but somehow we ended up with two |
The JSON above is correct, at least according to our intention on how to identify a class as a custom element. CustomElementDeclaration also needs to extend CustomElement though. As for the error, we have one interface that extends another. Additional fields in the sub-interface should be legal. TypeScript has a check that unknown properties aren't allowed, but for some reason that isn't triggered when I tried to repro in Stackblitz: https://stackblitz.com/edit/typescript-plhrbv?file=index.ts I'd like to get a repro so that I can add a "test" (just an object literal like above) to ensure that CustomElementDeclaration extending CustomElement fixes it. I'll work up a PR with the change right away though. |
I originally opened this issue on the custom-elements-manifest analyzer (open-wc/custom-elements-manifest#43), but I'm told this is a bug in the spec, so reopening here.
In the custom-elements-manifest analyzer playground, use this custom element:
You'll get this JSON:
click to expand
If you compare this to the schema, it doesn't match because of
tagName
on theClassDeclaration
.You can repro using a simple TypeScript file:
click to expand
Then run:
You'll see the error:
Expected behavior
I would expect the output schema to match the one from
schema.d.ts
.The text was updated successfully, but these errors were encountered: