Using Prettier to format js code. Prettier seems to be using globby under the hood.
I tried the following:
$ prettier './**/*.{js, css}' '!assets/**'
$ prettier './**/*.{js, css}' '!(assets/**)'
$ prettier './**/*.{js, css}' '!assets/**/*.*'
$ prettier './**/*.{js, css}' '!(assets/**/*.*)'
$ prettier './**/*.{js, css}' 'assets/**/!*.*'
And in all cases, files in the assets
folder were included.
What's the correct way to do this ?
You can now exclude directories with the !
character. For example this command would format all .js
and .css
files in-place, excluding anything in the assets
directory.
"prettier --write **/*.{js, css} !assets/**"
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