Code Monkey home page Code Monkey logo

Comments (7)

webpro avatar webpro commented on August 22, 2024

Thanks for the report, but I don't seem to be able to access the repro.

from knip.

Jym77 avatar Jym77 commented on August 22, 2024

Sorry. I've fixed the permissions (hopefully…)
(I don't know much about codesandbox, but is it possible to have the links from knip's doc to pre-include most of the needed sharing options?)

from knip.

webpro avatar webpro commented on August 22, 2024

I'm seeing both foo.js and foo.ts in the same directory, is that intentional?

from knip.

Jym77 avatar Jym77 commented on August 22, 2024

Ah 💡 So you're saying that export * from "./foo" resolves as foo.js and thus considers foo.ts as ignored?

It is indeed my setup to keep everything in the same directory. This is for a library building and npm publish takes care of only bundling the *.js and *.d.ts files, so I don't need a separate dist directory.

from knip.

webpro avatar webpro commented on August 22, 2024

Ah 💡 So you're saying that export * from "./foo" resolves as foo.js and thus considers foo.ts as ignored?

Yeah, module resolution can only resolve to a single file, so the other will be ignored. There was a refactoring in module resolution, which was breaking for you for this reason.

It is indeed my setup to keep everything in the same directory. This is for a library building and npm publish takes care of only bundling the *.js and *.d.ts files, so I don't need a separate dist directory.

This is not common afaic, might be confusing for consumers of your lib. I would recommend to separate source and build/distribution artifacts.

Either way, it confuses Knip as it wants only source files. It supports both JS and TS so what's truth here?

from knip.

Jym77 avatar Jym77 commented on August 22, 2024

🤔 At least I understand where the problem comes from and why it's messy (modules resolutionS in JS is 🙄).

Maybe it is indeed time for a long overdue overhaul of my library structure… The setup form 2017 might not make that much sense now 😖

from knip.

webpro avatar webpro commented on August 22, 2024

Let's blame TypeScript for not setting the default value of outDir to e.g. ./dist/ :)

Going to close this one as "wontfix" or "invalid".

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.