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

Ignore unused exports from the entry point of library (package.json) #105

Open
mrseanryan opened this issue Jan 18, 2020 · 2 comments
Open

Comments

@mrseanryan
Copy link
Collaborator

Ignore unused exports from the entry point of library (package.json).

This could be useful for source code of libraries.

So if package.json says:

  "main": "lib/app.js",

Then use tsconfig.json to infer that src/app.ts is the entry point.
Then ignore unused exports from that file.

note: there is a workaround, using the ignorePaths=app.ts option - but that is not as nice to use.

@maneetgoyal
Copy link

Hi @mrseanryan, following up from #132

It's a nice enhancement. Hoping that the inference logic is quite robust. Some cases to think about are:

  1. Here's a TS library which has "main" in package.json as dist/index.js but no src/index.ts.
  2. In another TS project, I have "main": "dist/esm/index.js" because we are generating multiple types of distributions.

I'm sure you'd have some criteria to effectively handle multiple scenarios, but just pointing out some cases which I personally would benefit more from.


Further, it would be great if the users can provide a glob/regex to specify which files to analyze. It (along with the already existing ignoreFiles option) would offer a great amount of control. The README seems to have some formatting issue related to the ignoreFiles option though.

@mrseanryan
Copy link
Collaborator Author

mrseanryan commented Apr 12, 2020

Thank you @maneetgoyal for the library link. That library seems to be all .html or .tsx files no regular .ts files? To be honest, this kind of project is not something I've been thinking about (moistly working with ts and tsx files. So this example is interesting.

I will fix the README format.

For the glob/regex - have logged issue #136

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

No branches or pull requests

2 participants