Open anthonyshew opened 9 months ago
first you told to add this config for root package.json, ---
[Add Prettier to your repo](https://www.shew.dev/monorepos/guardrails/prettier#add-prettier-to-your-repo)
In your root package.json, you'll need to do two things:
Install prettier (and prettier-plugin-packagejson if you'd like to format those).
Add your formatting scripts.
./package.json
{
"name": "my-project",
"version": "0.1.0",
"scripts": {
"format": "prettier . \"!apps/** !packages/** !tooling/**\" --check --cache --cache-location='node_modules/.cache/.prettiercache'",
"format:fix": "prettier . \"!apps/** !packages/** !tooling/**\" --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn"
},
"devDependencies": {
"prettier": "^3.0.3",
"prettier-plugin-packagejson": "^2.4.3",
"turbo": "^1.10.13"
}
}
then in documentation last you told
[Run your format tasks.] (https://www.shew.dev/monorepos/guardrails/prettier#run-your-format-tasks)
With all of that ready to go, we're now ready to start our tasks!
In the root of our monorepo, we will create these scripts:
package.json
{
"scripts": {
"format": "turbo format --continue",
"format:fix": "turbo format:fix --continue"
}
}
what to write in root package.json is my confusion
In my Prettier doc, I make it sound like you should put all the configuration at the root. Really, it should be put into a config workspace just like everything else and then brought up and out.