-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
gitignore support #92
Comments
i feel like #32 could probably work for these use cases |
Thanks for the issue and quick replies. nagated support would be cool however gitignore and glob ignore patterns are different (gitignore patterns are absolute paths relative to git root like For the context of my experience, With unjs/mkdist#265 I tried to workaround, however, regressions like unjs/unbuild#472 happened which finally had to do completely ignore gitignore story (unjs/mkdist#279) If supporting gitignore feels out of this project scope, I can understand, however it feel like a really missing part to make tinyglobby full replacement of globby |
supporting a globby option is not out of the scope of this project, but i'm not sure how feasible it would be to implement it without adding any more dependencies (minimal dependencies is the other goal of this project). so i'm open to adding it as long as no new deps are introduced (even if the gitignore feature is used by many, it's still a really low % of usages compared to total globby usages (i have not verified this but i remember it being this way)) |
From reading the docs, I wonder the That's just not how
I might be wrong, but from this I gather it wouldn't make sense to use the
Agreed with this, insofar I think it should be translated to both For the record, Knip uses an implementation and some tests around this topic: Nothing to be proud of, but does seem to do the job. Just a shame there's no glob lib that supports negated ignore patterns 😬😬
Such numbers are hard to get by, but usage of |
Maybe it's interesting to consider this approach: instead of adding the Then, we could do something like this (simplified): import tinyglobby from 'tinyglobby';
import ignore from 'ignore';
const files = tinyglobby(["**/*.js"], {
exclude: filePath => ignore(filePath)
}); There are still some concerns with this approach, I can think of at least:
The main idea is to basically pass on the This has the benefit that users can use node-ignore, something else, experiment with it, etc. It will also ease support for cq the migration to the Node.js built-in WDYT? I could try to whip up some PR + examples when I'll find some time. But only if there's interest and we have agreement on point 2. |
from nitrojs/nitro#3108 (comment):
The text was updated successfully, but these errors were encountered: