I have added a prettier
script in my package.json
so I can run it as part of my tests:
"prettier": "prettier --list-different \"**/*.{ts, js, css, scss, md}\""
I want all files from the above types to be checked by Prettier.
* --list-difference
just prints out the files that are not prettified and returns an error code so it's convenient to run in CI.
When I run
$ npm run prettier
Prettier returns 0 results even though I know there are files that are not prettified.
I am not sure what's going on, can someone please help me understand what's wrong with my glob matching ?
(Running in Ubuntu 18.04 with bash)
Found the issue.
In case anyone else is trying to match more than one file type, syntax is right but you cannot have spaces in the curly braces. So instead
"**/*.{js, ts, css, scss, md}"
It should be
"**/*.{js,ts,css,scss,md}"
This website helped me debug it easily: http://www.globtester.com/
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