Code Monkey home page Code Monkey logo

Comments (5)

webpro avatar webpro commented on June 20, 2024

By default, Knip does not report unused exports in entry files.

from knip.

btd1337 avatar btd1337 commented on June 20, 2024

@webpro thank you for responding, but that is not the case. This is not about the entry point file. The pattern occurs within other files that are not the entry point file.

from knip.

webpro avatar webpro commented on June 20, 2024

The src/test.ts file can also be an entry file, depending on the enabled plugins. That's why I'd need a reproduction to properly look into it.

You can also use --debug to get more verbose output, maybe it clears things up.

from knip.

btd1337 avatar btd1337 commented on June 20, 2024

I gave a very simple example. Add any other file as an entrypoint besides this other file as an example that I mentioned above.

You should have as behavior, that the unused function will not be detected.

My case is that I have a very large project, in which Knip is not able to detect many unused functions, and ts-prune can.
I tried to demonstrate a basic example of how to reproduce, because I believe that Knip should be able to replace ts-prune.

from knip.

webpro avatar webpro commented on June 20, 2024

Sorry, but without a reproduction there's nothing for me to look into. I hope you understand I can't copy-paste everyone's "how to reproduce" dumps.

There's reasons Knip works the way it does by default. There's various ways Knip can be configured to make it behave as you need.

Maybe you're looking for flags like these:

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.