prantlf / jsonlint

JSON/CJSON/JSON5 parser, syntax & schema validator and pretty-printer with a command-line client, written in pure JavaScript.
http://prantlf.github.io/jsonlint/
MIT License
37 stars 9 forks source link

Running jsonlint against '**/*.json' returns an error if no files found #20

Closed isuftin closed 2 months ago

isuftin commented 1 year ago
❯ jsonlint --quiet --compact --continue --no-duplicate-keys '**/*.json'
no files found
❯ echo $?
1

It would be amazing if there were an option to not have this return an error and instead to just continue on its merry way. We are using this utility as part of a general linting workflow in GitLab and sometimes we may run the utility without any json files to lint. We'd like to have it return the "no files found" message but instead return a 0 exit code.

prantlf commented 2 months ago

Thank you for the idea! I'm going to add an argument --succeed-with-no-files for this in the upcoming release.

prantlf commented 2 months ago

Released with 14.1.0, committed in 923f37fd4361d80886f9bcd4787630c9b331574d.