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

Improve TypeScript support + JSDoc #81

Merged
merged 16 commits into from
Mar 18, 2022
Merged

Improve TypeScript support + JSDoc #81

merged 16 commits into from
Mar 18, 2022

Conversation

rgossiaux
Copy link
Owner

This branch contains some big updates to TypeScript support by using the $$Props feature. This will:

  • Make TS understand the types of class and style correctly when used as functions of their slot props
  • Understand all HTML attribute props and reject unknown props that do not exist on the element, the same as HTML elements, which will make it much easier to eg convert React Tailwind UI code
  • Add JSDoc comments to props, which will be visible in your editor.

Merging this is blocked by a bug in SvelteKit's packaging: see sveltejs/kit#3783 I opened a PR for a possible fix to the language tools sveltejs/language-tools#1405 and depending on whether this or something else is merged, another (tiny) PR to Kit may be required.

@vercel
Copy link

vercel bot commented Mar 9, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/rgossiaux/svelte-headlessui/9rz76iQNrGsD31n7w2i75Hm676Re
✅ Preview: https://svelte-headlessui-git-better-types-rgossiaux.vercel.app

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