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

add exclude glob #2

Open
EdJoPaTo opened this issue Feb 3, 2022 · 2 comments
Open

add exclude glob #2

EdJoPaTo opened this issue Feb 3, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@EdJoPaTo
Copy link
Owner

EdJoPaTo commented Feb 3, 2022

A Repo containing Deno code does not contain a top level package.json. In order to check for this a negative glob has to be used.

Something like this could be neat:

alias denoBelow='project-below --exclude-file=package.json --file="*.ts" deno'
denoBelow lint

(Deno will probably also require #1 for many projects)

@EdJoPaTo EdJoPaTo added the enhancement New feature or request label Feb 3, 2022
@EdJoPaTo
Copy link
Owner Author

Deno will probably not work with this alone.
Assuming --file="**/*.ts" --exclude-file=package.json would match every directory which does not contain a package.json and some TypeScript file somewhere below.

Having the following directory structure

./a/b/package.json
./a/b/src/main.ts
./c/main.ts

would end up with these results, as all of them match the condition:

./a/
./a/b/src/
./c/

A simple idea to overcome this would be to not enter directories which already hit the exclude condition. But this also does not work. This would deny ./a/b/src/ as it is below the excluded ./a/b/ (contains package.json) but would still find the ./a/ directory which is also wrong.

@EdJoPaTo
Copy link
Owner Author

Deno uses deno.jsonc nowadays which is common in many Deno projects. The need for some kind of --exclude wasnt big enough for me to implement it.

When someone has a usecase for this feel free to mention it here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant