I found this answer how to format code using prettier
Here is what I've done
npm i prettier -g
prettier --write \"./**/*.{js,html}\"
Got an error [error] No files matching the pattern were found: ""./**/*.{js,html}"".
any ideas how to fix? do you think it is because I installed the prettier
globally (in the answer it is installed locally)?
So how would you use pettier when it is installed globally then?
One solution to this problem was suggested here : and actually worked for me. Notice I am on Windows machine, so am not sure how it will behave on others. Just remove anything before and after the expression (quotes):
prettier --write ./**/*.{js,html}
Probably the quotes are wrong. It should probably be:
prettier --write "./**/*.{js,html}"
without the backslashes.
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