-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
fix(turbo): add root prettier:fix task to format command #8109
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the format
script to properly format files in the root directory by ensuring the root-level prettier:fix
task is executed. The issue was that Turbo's prettier:fix
command only looked for scripts in workspace packages, missing the root-level formatting.
- Added a root-level prettier:fix task configuration in turbo.json
- Updated the format script to explicitly call the root prettier:fix task
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
turbo.json | Adds configuration for the root-level prettier:fix task with cache outputs |
package.json | Updates format script to explicitly include root prettier:fix task execution |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8109 +/- ##
==========================================
- Coverage 75.89% 75.88% -0.02%
==========================================
Files 112 112
Lines 9433 9433
Branches 303 303
==========================================
- Hits 7159 7158 -1
- Misses 2273 2274 +1
Partials 1 1 ☔ View full report in Codecov by Sentry. |
@adi-ray are you still working on this? |
The PR contains all the necessary changes required to fix the issue!
Not getting why the vercel deployment is failing 🤔 |
I'll investigate. |
Sitemap generation timed out on Vercel, redeploying... |
@@ -18,7 +18,7 @@ | |||
"cloudflare:preview": "turbo cloudflare:preview", | |||
"deploy": "turbo deploy", | |||
"dev": "turbo dev", | |||
"format": "turbo prettier:fix lint:fix", | |||
"format": "turbo //#prettier:fix prettier:fix lint:fix", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"format": "turbo //#prettier:fix prettier:fix lint:fix", | |
"format": "turbo //#prettier:fix lint:fix", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this also be node --run prettier:fix && turbo lint:fix
, since we don't even need turbo for prettier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since rest of the commands were only using turbo-based approach so gave preference to that.
But yeah, we can definitely use direct node.js execution for prettier & turbo for linting. Also then if we don't need turbo for prettier, we should remove the prettier tasks from turbo.json
?
Description
The
format
script was not properly callingprettier:fix
to format files in the root directory. The issue was thatturbo prettier:fix
only looked forprettier:fix
scripts in workspace packages, but the root-level script wasn't being executed.Validation
pnpm run format
now properly formats root files.Related Issues
Fixes #8108
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.