Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prettier error: No supported files were found in the directory

Tags:

prettier

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

like image 356
Ihor Byra Avatar asked Apr 14 '20 13:04

Ihor Byra


1 Answers

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.

like image 76
thorn0 Avatar answered Sep 21 '22 15:09

thorn0