Prettier version: 2.0.4
When I run the command: prettier -c src/**
I get an error: No supported files were found in the directory: "src/assets"
In the directory, I have 2 files: logo.png and loading.gif. Also, I added .png and .gif to .prettierignore
Short answer: just run prettier -c src
instead.
Explanation
You didn't put quotes around the glob, so it was expanded by your shell, not by Prettier. Prettier ended up called like this: prettier -c src/assets src/bananas ...
.
However, even if you used the quotes and the glob was expanded by Prettier, files like logo.png
would be matched by the glob, and Prettier would complain it doesn't know how to format them. To fix that, you could make your glob more selective (e.g. src/**/*.{js,css,html}
), but it's simpler just to pass a directory name to Prettier instead of a glob: prettier -c src
.
See the Prettier CLI docs for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With