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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: TSX output could type Astro.props automatically #499

Closed
Princesseuh opened this issue Aug 12, 2022 · 1 comment 路 Fixed by #518 or #547
Closed

馃悰 BUG: TSX output could type Astro.props automatically #499

Princesseuh opened this issue Aug 12, 2022 · 1 comment 路 Fixed by #518 or #547

Comments

@Princesseuh
Copy link
Member

What version of @astrojs/compiler are you using?

N/A

What package manager are you using?

N/A

What operating system are you using?

N/A

Describe the Bug

It'd be great if the TSX output would automatically type Astro.props with the types from the user's Props interface. This is a feature we always wanted to do and it's finally possible, so why not

Something like

declare const Astro: { props: Props } & Omit<import('astro').AstroGlobal, 'props'>

In the file should do the trick. It does create a weird Go To Definition behaviour, but GTD's behaviour on the Astro global is already weird because it goes into env.d.ts and not astro.d.ts like you'd expect. That's something we could fix in the language server manually or make it point to the Props interface etc

(Mainly making an issue for myself to remember, I can implement this)

Link to Minimal Reproducible Example

N/A

@Princesseuh Princesseuh changed the title 馃悰 BUG: TSX output should type Astro.props automatically 馃悰 BUG: TSX output could type Astro.props automatically Aug 12, 2022
@natemoo-re natemoo-re linked a pull request Sep 28, 2022 that will close this issue
@Princesseuh Princesseuh reopened this Oct 5, 2022
@natemoo-re
Copy link
Member

Note: #518 did NOT implement this, I was mistaken. Definitely something we can add, though.

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

Successfully merging a pull request may close this issue.

2 participants