Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis update introduces a comprehensive code quality and formatting system. It adds new configuration files for Biome and Ultracite, sets up pre-commit hooks and lint-staged for automated formatting, updates VSCode settings to use Biome as the default formatter, and enforces strict null checks in TypeScript. No application logic was changed. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Git
participant Husky Pre-commit Hook
participant Ultracite
Developer->>Git: git commit
Git->>Husky Pre-commit Hook: Trigger pre-commit
Husky Pre-commit Hook->>Ultracite: npx ultracite format
Ultracite-->>Husky Pre-commit Hook: Format codebase
Husky Pre-commit Hook-->>Git: Allow commit if formatting passes
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
package.json (1)
24-27:lint-stagedblock is fine but may double-run formatting with Husky hook
lint-stagedinvokesnpx ultracite formatand the Husky hook runs the same command unconditionally.
Consider removing one to avoid redundant work on every commit..cursor/rules/ultracite.mdc (1)
7-276: Consider replacing the 270-line bullet dump with extends & overrides.A flat, monolithic list is:
• hard to audit (duplicates / contradictions slip in),
• painful to diff in future PRs,
• and discourages rule-specific doc links or severities.Ultracite supports composition (
extends: [...], per-rule config). Suggest splitting into thematic presets (accessibility, language, React, Next.js, security, misc) and referencing them:extends: - ultracite/presets/a11y - ultracite/presets/react - ultracite/presets/security # project-specific tweaks rules: no-console: warn # allow during dev ...This keeps the ruleset maintainable and discoverable.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
.cursor/rules/ultracite.mdc(1 hunks).husky/pre-commit(1 hunks).vscode/settings.json(2 hunks)biome.jsonc(1 hunks)package.json(1 hunks)tsconfig.json(1 hunks)
🔇 Additional comments (3)
tsconfig.json (1)
1-5: Consider enabling fullstrictmode or run a compilation check before merging
"strictNullChecks": trueis a good first step, but many teams turn on the entire"strict": trueumbrella to avoid a piecemeal rollout later.
At minimum, please runpnpm tsc -p tsconfig.json --noEmit(or the equivalent turbo task) on the branch to ensure the stricter null-checking doesn’t introduce new compilation errors.biome.jsonc (1)
1-6: LGTM – minimal Biome config extendingultraciteNo issues spotted.
.cursor/rules/ultracite.mdc (1)
3-4: Verify that the glob pattern is accepted by Ultracite/Biome.The brace‐expansion
**/*.{ts,tsx,js,jsx}is convenient, but several glob engines (including some Node-based libraries) don’t expand the inner braces unless the pattern is passed throughbash -O extglob-style processing.Please confirm that Ultracite’s resolver recognises this pattern; otherwise you may silently fail to lint
.tsx/.jsxfiles.
| @@ -0,0 +1 @@ | |||
| npx ultracite format No newline at end of file | |||
There was a problem hiding this comment.
Hook is missing Husky boilerplate & she-bang – will fail at commit time
A Husky hook file must start with a she-bang and source Husky’s helper, e.g.:
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
npx ultracite formatWithout the shebang Git will raise “Exec format error” on Unix, and without the helper line HUSKY env vars (used by husky.sh) aren’t initialised.
Please patch before merging.
📝 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.
| npx ultracite format | |
| #!/usr/bin/env sh | |
| . "$(dirname -- "$0")/_/husky.sh" | |
| npx ultracite format |
🤖 Prompt for AI Agents
In .husky/pre-commit at line 1, the hook script is missing the required she-bang
line and Husky helper sourcing. Add the she-bang line "#!/bin/sh" at the top and
source Husky's helper script by adding ". "$(dirname "$0")/_/husky.sh""
immediately after. This ensures the hook runs correctly and Husky environment
variables are initialized.
| "devDependencies": { | ||
| "@biomejs/biome": "2.0.5", | ||
| "husky": "^9.1.7", | ||
| "lint-staged": "^16.1.2", | ||
| "prettier": "^3.5.0", | ||
| "turbo": "^2.4.2", | ||
| "typescript": "5.7.3" | ||
| "typescript": "5.7.3", | ||
| "ultracite": "5.0.26" | ||
| }, |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Toolchain divergence: ESLint/Prettier scripts kept while moving to Biome/Ultracite
You now depend on @biomejs/biome + ultracite, yet npm run format still points to Prettier and npm run lint to ESLint. Keeping three formatters/linter stacks will confuse contributors and CI.
Suggested options:
- Replace the
formatandlintscripts with Biome/Ultracite equivalents. - Drop Prettier & ESLint dev deps to avoid version drift.
🤖 Prompt for AI Agents
In package.json lines 11 to 19, the project includes both Biome/Ultracite and
ESLint/Prettier toolchains, causing redundancy and potential confusion. Update
the npm scripts for `format` and `lint` to use Biome and Ultracite commands
instead of Prettier and ESLint. Then remove the Prettier and ESLint
devDependencies to avoid maintaining multiple formatting and linting tools.
| "source.organizeImports": "explicit", | ||
| "source.fixAll.biome": "explicit", | ||
| "source.organizeImports.biome": "explicit" | ||
| }, |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Biome actions added – good, but Prettier remains the default per language
Lines 22-32 still set "editor.defaultFormatter": "esbenp.prettier-vscode" for JS/TS files, so VSCode will prefer Prettier over Biome despite new code-actions. Decide on one canonical formatter and drop the conflicting overrides.
🤖 Prompt for AI Agents
In .vscode/settings.json around lines 11 to 14 and also lines 22 to 32, there is
a conflict between Biome and Prettier as default formatters for JS/TS files. To
fix this, choose either Biome or Prettier as the canonical formatter and remove
the conflicting "editor.defaultFormatter" overrides for the other formatter in
the language-specific settings. This will ensure VSCode uses only the selected
formatter consistently.
| "editor.tabSize": 2, | ||
| "[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]": { | ||
| "editor.defaultFormatter": "biomejs.biome" | ||
| }, | ||
| "typescript.tsdk": "node_modules/typescript/lib", | ||
| "editor.formatOnPaste": true, | ||
| "emmet.showExpandedAbbreviation": "never" | ||
| } No newline at end of file |
There was a problem hiding this comment.
Invalid composite language key – VSCode will ignore it
"[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]" is not a valid VSCode language-specific selector. It must be one language per bracket, e.g.:
-"[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]": {
- "editor.defaultFormatter": "biomejs.biome"
-},
+"[javascript]": { "editor.defaultFormatter": "biomejs.biome" },
+"[typescript]": { "editor.defaultFormatter": "biomejs.biome" },
+"[javascriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
+"[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
+"[json]": { "editor.defaultFormatter": "biomejs.biome" },
+"[jsonc]": { "editor.defaultFormatter": "biomejs.biome" },
+"[css]": { "editor.defaultFormatter": "biomejs.biome" },
+"[graphql]": { "editor.defaultFormatter": "biomejs.biome" },Without this fix, Biome will never be triggered as the formatter.
📝 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.
| "editor.tabSize": 2, | |
| "[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]": { | |
| "editor.defaultFormatter": "biomejs.biome" | |
| }, | |
| "typescript.tsdk": "node_modules/typescript/lib", | |
| "editor.formatOnPaste": true, | |
| "emmet.showExpandedAbbreviation": "never" | |
| } | |
| "editor.tabSize": 2, | |
| "[javascript]": { "editor.defaultFormatter": "biomejs.biome" }, | |
| "[typescript]": { "editor.defaultFormatter": "biomejs.biome" }, | |
| "[javascriptreact]": { "editor.defaultFormatter": "biomejs.biome" }, | |
| "[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" }, | |
| "[json]": { "editor.defaultFormatter": "biomejs.biome" }, | |
| "[jsonc]": { "editor.defaultFormatter": "biomejs.biome" }, | |
| "[css]": { "editor.defaultFormatter": "biomejs.biome" }, | |
| "[graphql]": { "editor.defaultFormatter": "biomejs.biome" }, | |
| "typescript.tsdk": "node_modules/typescript/lib", | |
| "editor.formatOnPaste": true, | |
| "emmet.showExpandedAbbreviation": "never" | |
| } |
🤖 Prompt for AI Agents
In .vscode/settings.json around lines 36 to 43, the language-specific editor
settings use an invalid composite key combining multiple languages in one
bracket, which VSCode ignores. Fix this by splitting the key into separate
entries for each language, each with its own bracket, all pointing to
"editor.defaultFormatter": "biomejs.biome". This ensures Biome is correctly
triggered as the formatter for all specified languages.
e9aff06 to
21a836f
Compare
Summary by CodeRabbit
New Features
Chores