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

Importing library in TypeScript environment #6

Closed
DamianGlowala opened this issue Oct 1, 2021 · 4 comments
Closed

Importing library in TypeScript environment #6

DamianGlowala opened this issue Oct 1, 2021 · 4 comments

Comments

@DamianGlowala
Copy link

DamianGlowala commented Oct 1, 2021

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 :)

image
image

@alfonsobries
Copy link
Contributor

@DamianGlowala 🤔 it should work out of the box, maybe I broke something recently will take a look this weekend and let you know

@alfonsobries
Copy link
Contributor

@DamianGlowala pd will love to see that plugin

@DamianGlowala
Copy link
Author

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

@alfonsobries
Copy link
Contributor

alfonsobries commented Oct 3, 2021

@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

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

No branches or pull requests

2 participants