-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Labels
- P2: has workaroundAn edge case that only affects very specific usage, but has a trivial workaround (priority)An edge case that only affects very specific usage, but has a trivial workaround (priority)ecosystem: upstreamUpstream package has issueUpstream package has issuepkg: language-toolsRelated to language-tooling (scope)Related to language-tooling (scope)
Description
What version of astro are you using?
2.8.3
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Linux
What browser are you using?
Chrome
Describe the Bug
I add svelte into my new project with pnpm astro add svelte
After writing some component with svelte using TS, I have a couple of typed props like position and whereTo:
<script lang="ts">
import Home from "svelte-material-icons/Home.svelte";
export let position:
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right" = "bottom-right";
export let whereTo: string = "#";
const positionClass = `FAB-${position}`;
</script>I'm adding this component directly to Astro page. But Astro doesn't seem to be aware about defined props because when I'm hovering over a component in .astro file typing looks like this:
(alias) function FAB(_props: any): any
import FABTypes when importing svelte component into another svelte component works perfectly fine. Type when hovering over looks like this:
(alias) class FAB
import FABWhat's the expected result?
Proper types in .astro file. Or at least the opportunity to define them manually. I'm sorry if there is one, but I can't find information about it.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-njqqdd?file=src%2Fpages%2Findex.astro
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
- P2: has workaroundAn edge case that only affects very specific usage, but has a trivial workaround (priority)An edge case that only affects very specific usage, but has a trivial workaround (priority)ecosystem: upstreamUpstream package has issueUpstream package has issuepkg: language-toolsRelated to language-tooling (scope)Related to language-tooling (scope)