Code Monkey home page Code Monkey logo

Comments (5)

webpro avatar webpro commented on September 23, 2024 2

Alright, cool!

I appreciate the feedback, at the very least it serves as a reminder that custom resolvers could be a very useful feature (perhaps a bit similar to how custom compilers fit in pretty well).

from knip.

webpro avatar webpro commented on September 23, 2024

Probably the easiest way is to add the auto-imported components to the entry paths.

from knip.

joris-gallot avatar joris-gallot commented on September 23, 2024

Does that mean if a component is no longer used, I won't get a Knip error?
I've tested it, and I don't get any errors, do you think there might be a way to trigger an error if a component is not used (thus not imported)?

from knip.

webpro avatar webpro commented on September 23, 2024

Does that mean if a component is no longer used, I won't get a Knip error?

No, entry files are glob matches, even zero matches is not an error. And they don't need to be import-ed by another module.

I've tested it, and I don't get any errors, do you think there might be a way to trigger an error if a component is not used (thus not imported)?

Since the components are auto-imported, there's no way for Knip to understand this. Knip basically works from entry files and then following import statements.

Custom resolvers don't work great with Knip I'm afraid. I don't currently see an easy way to add a custom resolver. But feel free to explore this, I'm open to something clean and maintainable.

Or... don't use magic and explicitly import components.

from knip.

joris-gallot avatar joris-gallot commented on September 23, 2024

Thanks for the details and quick responses!

I think we can close this for now; I'm not ready to explore more on this

from knip.

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.