Importing library in TypeScript environment
DamianGlowala opened this issue · 4 comments
I am making a Nuxt.js plugin which will register VariantJS. @alfonsobries, have you came across the following issues while using TypeScript? Seems like variantJS variable mentioned in readme isn't exported for external use. I looked at the core lib but it doesn't appear to be available there either. Do we also need to explicitly add an entry to types
in tsconfig.json to deal with the second error (shown below)?
PS. Big thumbs up for typed config! So much less error prone :)
@DamianGlowala
@DamianGlowala pd will love to see that plugin
VariantJS is exported in the following way plugin as variantJsPlugin
(either docs can be amended or the code to remove this discrepancy - whichever sounds more reasonable) :)
Regarding the second issue, it comes from eslint (so technically I assume there could be a space for improvement but this can no longer be considered an issue):
https://github.com/import-js/eslint-plugin-import/blob/v2.24.2/docs/rules/named.md
@DamianGlowala I see the problem the readme says that you should use the @variantjs/vue@next
version (with next
suffix) but that was incorrect you should use the regular release
npm install @variantjs/vue --save
Just updated the docs