I have a unformatted json file that gets stored in my application with the following structure
src
/forms
/test
- abc.json
I am using husky and lint-staged to make use of prettier and linting on pre-commit. The configuration resides in my package.json as following
"husky": {
"hooks": {
"pre-commit": "lint-staged --relative",
"pre-push": "tsc"
}
},
"lint-staged": {
"src/**/*.{ts, json}": [
"prettier --write",
"eslint --fix"
]
},
....
..
But for some reason the abc.json file never gets formatted when I push my code to github. What am I missing?
There's an error in your glob pattern. Patterns within curly braces should only be delimited by a comma
You have:
"src/**/*.{ts, json}"
Instead, remove the space in the pattern as follows:
"src/**/*.{ts,json}"
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