Open bobby-driggs opened 5 months ago
A better workaround i discovered, based on this old typescript github issue: https://github.com/Microsoft/TypeScript/issues/6615
is to just declare within an type definition file: carbonIcons.d.ts
this code:
declare module '@carbon/icons-vue/es/*' {}
which will catch all wildcard import for any icon under that path.
Would love to see a more "native" solution to this problem tho
This issue has been marked as stale because it has required additional info or a response from the author for over 14 days. When you get the chance, please comment with the additional info requested. Otherwise, this issue will be closed in 28 days.
@sstrubberg I think this should go back to https://github.com/carbon-design-system/carbon/tree/main/packages/icons-vue The vue icons are produced from there.
This issue has been marked as stale because it has required additional info or a response from the author for over 14 days. When you get the chance, please comment with the additional info requested. Otherwise, this issue will be closed in 28 days.
Package
@carbon/icons-vue
Browser
Chrome
Package version
10.83.1
React version
Vue 3.4.27
Description
When I run my vite type checker:
vue-tsc --build ...
I get the following errorsFor every icon I am importing.
FWIW: The icons do render properly - this seems to be a pure typing error with TypeScript. This is important as we have a type check on our build server, so i need some way of resolving this.
Workaround: I can set
"noImplicitAny": false
, in thetsconfig.json
options file, but that seems like a nuclear optionReproduction/example
none
Steps to reproduce
Create a new vite application, follow the usage steps here: https://github.com/carbon-design-system/carbon/tree/main/packages/icons-vue#usage
import NOT globally, then try and check typescript build, note all the icons are missing types.
Suggested Severity
None
Application/PAL
No response
Code of Conduct