Skip to content
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

Importing component from theme folder misses types #7073

Closed
steverep opened this issue Jan 11, 2024 · 1 comment · Fixed by #7087
Closed

Importing component from theme folder misses types #7073

steverep opened this issue Jan 11, 2024 · 1 comment · Fixed by #7087
Labels
typescript TypeScript definitions issue

Comments

@steverep
Copy link
Contributor

Description

Files in the theme/*/ folders have no Typescript declarations. This means that importing from these folders misses defining the elements on the global HTMLElementTagNameMap. As a result, a linting rule like no-missing-import from lit-plugin fails, and other rules cannot be checked because there's no class to associate the tag with.

There's a very old related issue #237, but this problem could easily be fixed just by putting TS declarations in the theme folders.

Expected outcome

Element should be defined on the global map.

Minimal reproducible example

import "@vaadin/combo-box/theme/material/vaadin-combo-box-light";
import { html } from "lit";

// Not linted because type not defined...
const temp = html`<vaadin-combo-box-light></vaadin-combo-box-light>`;

Steps to reproduce

Import from theme folder and lint with lit-plugin or lit-analyzer.

Environment

n/a

Browsers

No response

@web-padawan web-padawan added the typescript TypeScript definitions issue label Jan 12, 2024
@web-padawan
Copy link
Member

Thanks for the issue. Apart from lit-analyzer, the fact that .d.ts files are lacking also affects dynamic imports:

Screenshot 2024-01-12 at 10 40 04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript TypeScript definitions issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants