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

Type declarations should work for package imports #9540

Closed
brandones opened this issue Aug 25, 2021 · 4 comments
Closed

Type declarations should work for package imports #9540

brandones opened this issue Aug 25, 2021 · 4 comments
Labels
area: typescript proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡

Comments

@brandones
Copy link
Contributor

@types/carbon-components-react doesn't provide types for ES package imports, e.g. carbon-components-react/es/components/UIShell. Typescript complains:

Could not find a declaration file for module 'carbon-components-react/es/components/UIShell'. '/path/project/node_modules/carbon-components-react/es/components/UIShell/index.js' implicitly has an 'any' type.
If the 'carbon-components-react' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/carbon-components-react'ts(7016)

@floydjones1
Copy link

Can this be considered high priority? Is there any plans for brining typescript support directly from carbon-components-react instead of relying on @types/carbon-components-react. I'm finding that the types provided by @types/carbon-components-react is incorrect at times aswell

@Daveiano
Copy link

Daveiano commented Dec 13, 2021

What is the state when using the new @carbon/react?

The page at https://github.com/carbon-design-system/carbon-components-react says we should use this package instead but there is no typescript support yet because @types/carbon-components-react is for the deprecated repo?

Also the documentation on https://www.carbondesignsystem.com/developing/react-tutorial/step-1 seems to be quite outdated?

@joshblack
Copy link
Contributor

For TypeScript discussions, I made a discussion over at: #10752

This should be where teams can find the most up-to-date information on where our team is at with respect to TypeScript. At the moment, the types are community-provided and supported and we do not have influence over them. This is more of a logistics problem than anything else on our end, if teams would like to help I would love to chat more in the discussion.

Definitely am sorry that the situation for TypeScript is as rough and confusing as it currently is. It's definitely not our intention and we are trying to see what we could provide to improve this experience.

@sstrubberg sstrubberg added proposal: accepted This request has gone through triaging and we are accepting PR's against it. area: typescript labels Dec 19, 2022
@tay1orjones
Copy link
Member

Duplicate of #16436

@tay1orjones tay1orjones marked this as a duplicate of #16436 Sep 11, 2024
@tay1orjones tay1orjones closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: typescript proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡
Projects
Archived in project
Development

No branches or pull requests

6 participants