Giter Site home page Giter Site logo

Comments (7)

 avatar commented on June 14, 2024 1

It looks like vue-property-decorator is only used in tests in that PR. Would it be possibly to write the tests to just test vuelidate? Note that tests just need to typecheck, not run, so you could add declare const to represent other libraries if necessary.

from types-publisher.

 avatar commented on June 14, 2024 1

vue itself is already in the whitelist. I would recommend using that instead of making your own copy of vue types.

from types-publisher.

janesser avatar janesser commented on June 14, 2024

@andy-ms thanks for the quick answer.

point is that vuelidate is nested in the @component annotation, which need to be either imported from vue-class-component or vue-property-decorator, which ships it indirectly.

In my opinion test-case should be close to real usage scenario. For now including vue-property-decorator sounds like the way to get there.

Do i miss some alternative?

from types-publisher.

 avatar commented on June 14, 2024

I don't think it's worth it to whitelist a new external dependency (which would get added as a dependency of the @types package) just for tests -- it should be possible to write a simple shim for vue-property-decorator. It doesn't have to actually work at runtime, just have the right type.

from types-publisher.

janesser avatar janesser commented on June 14, 2024

Thanks for your advice,
regarding the parts from vue-property-declarator i have been able to create some "shims" that fullfil the job nicely. I noticed that "// $ExpectType CustomRule" will not work with type aliases, well fine.

But there is yet another issue with @types/vue which clearly deprecated, see https://www.npmjs.com/package/@types/vue.

It comes handy to be still availble in the whitelist even, although it feels wrong using deprecated things.

I tried to create shims for this one as well, but the module augmentation does not work with w<hat i tried.

@andy-ms
You could do me a big favour in pointing me to an example of "module augmentation" working with shims, is there something like that?

Regards

from types-publisher.

 avatar commented on June 14, 2024

@types/vue was deprecated because vue has its own types now, so you should probably be using that instead.
Not sure what you mean by module augmentation of a shim -- if you're not using a module and using a shim instead you presumably don't need to augment it? Or if that module had included an augmentation of something else, you could just copy that to your tests file.

from types-publisher.

janesser avatar janesser commented on June 14, 2024

@andy-ms it is about augmentation of "vue/types/vue" with @types/vue as dependency it works fine.

depending on original typing of vue, would probably require another whitelisting, that's why i tried to declare the parts of "vue/types/vue" in the test, but the augmentation from vue.d.ts does not apply.

from types-publisher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.