Closed Shayan-To closed 2 years ago
A good point! Instead of running jsonlint .
, you have to list every file directory by jsonlint dir1 dir2 dir3 file1.json
. Being able to exclude some paths would be a nice feature. Maybe using glob patterns to have the ultimate flexibility.
I added support for BASH patterns in 11.2.0. Instead of specifying a directory, specify a (positive) pattern to identify all JSON files in your project and another (negative) pattern to exclude files from, the node_modules
directory (from node_modules
in any subdirectory):
jsonlint --sort-keys --in-place --log-files '**/*.json' '!**/node_modules'
How can I lint all json files in my project? When I run it like
jsonlint --sort-keys --in-place .
, it tries to run against the json files innode_modules
directory. How can I ignore thenode_modules
directory?