You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using vue-cli with Typescript, after installing oruga-next with npm, importing from '@oruga-ui/oruga-next' fails:
Could not find a declaration file for module '@oruga-ui/oruga-next'. '/home/franck/devel/git-repositories/tethys/node_modules/@oruga-ui/oruga-next/dist/cjs/index.js' implicitly has an 'any' type.
To work this around, I had to "provide custom typings about this module".
Create a folder named "typings-custom" at the root of your project
Reference the content of this folder in your tsconfig.json:
"include": [
"./typings-custom/**/*.ts"
]
Create a file with this exact name: foo.d.ts [foo = the name of the module] with the content:
declare module 'foo'
Your TypeScript code should now compile, albeit with NO type information (TypeScript consider the foo module of type "any").
As Vue 3 improves Typescript compatibility, more and more users could opt for TypeScript. Having Oruga-next work out of the box would be a cool feature. Moreover, good typing could improve code quality.
The text was updated successfully, but these errors were encountered:
Description
When using vue-cli with Typescript, after installing oruga-next with npm, importing from '@oruga-ui/oruga-next' fails:
Could not find a declaration file for module '@oruga-ui/oruga-next'. '/home/franck/devel/git-repositories/tethys/node_modules/@oruga-ui/oruga-next/dist/cjs/index.js' implicitly has an 'any' type.
To work this around, I had to "provide custom typings about this module".
(see https://stackoverflow.com/questions/38224232/how-to-consume-npm-modules-from-typescript==
Why Oruga need this feature
As Vue 3 improves Typescript compatibility, more and more users could opt for TypeScript. Having Oruga-next work out of the box would be a cool feature. Moreover, good typing could improve code quality.
The text was updated successfully, but these errors were encountered: