Skip to content

feat: add ultracite config#15

Open
ericjypark wants to merge 1 commit intomainfrom
build/ultracite
Open

feat: add ultracite config#15
ericjypark wants to merge 1 commit intomainfrom
build/ultracite

Conversation

@ericjypark
Copy link
Copy Markdown
Owner

@ericjypark ericjypark commented Jun 30, 2025

Summary by CodeRabbit

  • New Features

    • Introduced automated code formatting and linting using Biome and Ultracite tools.
    • Added comprehensive coding and accessibility guidelines enforced across the codebase.
    • Implemented a pre-commit hook to automatically format code before each commit.
    • Enabled strict null checks for TypeScript.
  • Chores

    • Updated development dependencies and configuration files to support new formatting and linting tools.
    • Enhanced VSCode settings for improved code formatting and consistency.

@ericjypark ericjypark self-assigned this Jun 30, 2025
@vercel
Copy link
Copy Markdown

vercel bot commented Jun 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bookmarket ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 1:31am

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 30, 2025

Walkthrough

This 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

File(s) Change Summary
.cursor/rules/ultracite.mdc Added global ruleset for code and accessibility best practices for JS/TS/JSX/TSX files.
.husky/pre-commit Added pre-commit hook to run npx ultracite format before each commit.
.vscode/settings.json Updated to use Biome as default formatter and fixer; added related editor settings.
biome.jsonc Added Biome configuration extending the "ultracite" preset with schema version 2.0.5.
package.json Added dev dependencies: Biome, Husky, lint-staged, Ultracite; configured lint-staged for formatting.
tsconfig.json Added with "strictNullChecks": true to enforce strict null checks in TypeScript.

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
Loading

Poem

A bunny hopped through fields of code,
With Biome and Ultracite in its load.
Husky guards each commit gate,
Formatting neat, never late.
TypeScript’s nulls now strictly checked—
In this garden, code is perfect!
🐇✨


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
package.json (1)

24-27: lint-staged block is fine but may double-run formatting with Husky hook

lint-staged invokes npx ultracite format and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2e73ebb and c06781e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is 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 full strict mode or run a compilation check before merging

"strictNullChecks": true is a good first step, but many teams turn on the entire "strict": true umbrella to avoid a piecemeal rollout later.
At minimum, please run pnpm 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 extending ultracite

No 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 through bash -O extglob-style processing.

Please confirm that Ultracite’s resolver recognises this pattern; otherwise you may silently fail to lint .tsx / .jsx files.

@@ -0,0 +1 @@
npx ultracite format No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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 format

Without 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.

Suggested change
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.

Comment on lines 11 to 19
"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"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ 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:

  1. Replace the format and lint scripts with Biome/Ultracite equivalents.
  2. 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.

Comment on lines +11 to 14
"source.organizeImports": "explicit",
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ 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.

Comment on lines +36 to +43
"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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
"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.

@ericjypark ericjypark force-pushed the main branch 2 times, most recently from e9aff06 to 21a836f Compare December 31, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant