Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarity for Prettier doc. #90

Open
anthonyshew opened this issue Sep 23, 2023 · 1 comment
Open

Clarity for Prettier doc. #90

anthonyshew opened this issue Sep 23, 2023 · 1 comment
Labels

Comments

@anthonyshew
Copy link
Owner

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.

@ketanMehtaa
Copy link

ketanMehtaa commented Apr 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants