How to call a command over every .json file in a directory with different file extensions?

377 Views Asked by At

I am trying to write a npm script (bash) to run the command jsonlint -q over every .json file in a directory that contains files of other extensions.

This is what I have so far, but it only works for the first json file in the directory. Different things I've tried end up running it over every file regardless of extension.

ls folder/subfolder/ *.json | xargs jsonlint -q

0

There are 0 best solutions below