You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use v8r in a lint step of my project. But then I end up having to specify a bunch of files separately to be checked because some auto-generated files should not be checked (and/or do not have schemas).
Example: when verifying an entire repository with npx v8r "./**/*.json" it will dig deep into node_modules. Then by limiting it to npx v8r "./*.json" "./src/**/*.json" we still run into problems where package-lock.json has no schema (and really does not need to be checked).
It would be great if it could follow in the footsteps of some other linting projects and take .gitignore into account. Though that will often not cover everything. Something like an --exclude flag for the cli might be easier, for opting out specific files rather than having to opt-in everything manually.
The text was updated successfully, but these errors were encountered:
I like the idea of respecting .gitignore. Either by default or via an option. I'll take that one on board next time I have some time free to work on this project 👍
To solve your immediate issue, the glob library v8r uses supports extglob syntax, so you can run
v8r "./!(node_modules)/**/*.json" "./*.json"
to validate all json files but ignore node_modules
I did not know about that syntax. I will play around with it a little bit, and if it solves my direct concern I might even file a PR against the v8r docs so others will not down the same path as me 👍
I will close this issue after I have tried it out.
I would like to use v8r in a lint step of my project. But then I end up having to specify a bunch of files separately to be checked because some auto-generated files should not be checked (and/or do not have schemas).
Example: when verifying an entire repository with
npx v8r "./**/*.json"
it will dig deep into node_modules. Then by limiting it tonpx v8r "./*.json" "./src/**/*.json"
we still run into problems where package-lock.json has no schema (and really does not need to be checked).It would be great if it could follow in the footsteps of some other linting projects and take .gitignore into account. Though that will often not cover everything. Something like an
--exclude
flag for the cli might be easier, for opting out specific files rather than having to opt-in everything manually.The text was updated successfully, but these errors were encountered: