chore: add format script for codebase styling consistency#723
Conversation
📝 WalkthroughWalkthroughA new ChangesFormat Script Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 18: The package.json script "format": "prettier --write \".\"" uses the
Prettier CLI but Prettier is not declared in the root devDependencies; add
"prettier" (with a specific version, e.g. "^x.y.z") to the root package.json
devDependencies so the format script is reproducible in fresh installs/CI and
update package-lock/yarn.lock by running an install; reference the "format"
script and ensure the dependency is added to devDependencies in package.json.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| "bench": "bun packages/core/src/benchmark/render-loop.ts", | ||
| "clean": "turbo run clean && rm -rf node_modules" | ||
| "clean": "turbo run clean && rm -rf node_modules", | ||
| "format": "prettier --write \".\"" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that the root package.json has a format script and whether prettier is declared.
python - <<'PY'
import json, pathlib
p = pathlib.Path("package.json")
data = json.loads(p.read_text())
scripts = data.get("scripts", {})
dev = data.get("devDependencies", {})
print("format script:", scripts.get("format"))
print("prettier in devDependencies:", "prettier" in dev)
if "prettier" in dev:
print("prettier version:", dev["prettier"])
PYRepository: Karanjot786/TermUI
Length of output: 133
Declare prettier in root devDependencies so format is reproducible
"format": "prettier --write \".\"" invokes the prettier CLI, but prettier is not declared in this repo’s root devDependencies, so it can fail on clean installs/CI.
"devDependencies": {
"`@types/bun`": "latest",
"`@types/node`": "^25.2.3",
+ "prettier": "^3.3.3",
"tsup": "^8.3.0",
"turbo": "^2.9.12",
"typescript": "^5.7.0",
"vitest": "^2.1.0"
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "format": "prettier --write \".\"" | |
| "devDependencies": { | |
| "`@types/bun`": "latest", | |
| "`@types/node`": "^25.2.3", | |
| "prettier": "^3.3.3", | |
| "tsup": "^8.3.0", | |
| "turbo": "^2.9.12", | |
| "typescript": "^5.7.0", | |
| "vitest": "^2.1.0" | |
| }, |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 18, The package.json script "format": "prettier --write
\".\"" uses the Prettier CLI but Prettier is not declared in the root
devDependencies; add "prettier" (with a specific version, e.g. "^x.y.z") to the
root package.json devDependencies so the format script is reproducible in fresh
installs/CI and update package-lock/yarn.lock by running an install; reference
the "format" script and ensure the dependency is added to devDependencies in
package.json.
Review: prettier missing from devDependenciesThe Add to root package.json devDependencies: "prettier": "^3.3.0"Pin a specific version so the format output stays reproducible across machines. |
|
Thank you so much for your contribution, @Rish-2006! Your PR #723 added a format script to the root package. Running bun run format now applies Prettier across the whole codebase in one step. Keep contributing. We appreciate your work. |
Closes #721
Summary by CodeRabbit
Release Notes