Skip to content

Conversation

@chmurson
Copy link
Collaborator

No description provided.

@netlify
Copy link

netlify bot commented Aug 22, 2025

Deploy Preview for graypaper-reader ready!

Name Link
🔨 Latest commit 98d8fa7
🔍 Latest deploy log https://app.netlify.com/projects/graypaper-reader/deploys/68a8384bdab17d0008dc7a31
😎 Deploy Preview https://deploy-preview-276--graypaper-reader.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Aug 22, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Adds Husky Git hooks for pre-commit and commit-msg, introduces Commitlint configuration, and updates package.json to install Husky and Commitlint via devDependencies with a prepare script.

Changes

Cohort / File(s) Summary of Changes
Git hooks (Husky)
.husky/pre-commit, .husky/commit-msg
Adds pre-commit hook to run Biome with write, refresh Git index, and run TypeScript no-emit check; adds commit-msg hook to run commitlint on the commit message.
Commitlint config
commitlint.config.js
Adds default export extending @commitlint/config-conventional.
Package config
package.json
Adds prepare script (husky) and devDependencies: husky, @commitlint/cli, @commitlint/config-conventional.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Dev as Developer
    participant Git as Git
    participant Husky as Husky Hooks
    participant Biome as Biome
    participant TSC as TypeScript
    participant CL as Commitlint

    Dev->>Git: git commit
    Git->>Husky: Run pre-commit
    Husky->>Biome: biome check --write --no-errors-on-unmatched
    Biome-->>Husky: status
    Husky->>Git: git update-index --again
    Husky->>TSC: tsc --noEmit -p ./tsconfig.app.json
    TSC-->>Husky: status
    alt pre-commit fails
        Husky-->>Git: non-zero exit
        Git-->>Dev: Abort commit
    else pre-commit passes
        Git->>Husky: Run commit-msg
        Husky->>CL: commitlint --edit $1
        alt commitlint fails
            Husky-->>Git: non-zero exit
            Git-->>Dev: Abort commit
        else commitlint passes
            Husky-->>Git: success
            Git-->>Dev: Commit created
        end
    end

    note over Husky: New/modified control flow: pre-commit checks (Biome, TSC) and commit-msg linting
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-husky

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

@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: 2

🧹 Nitpick comments (3)
.husky/pre-commit (1)

2-4: Optional: speed up the hook for large repos

  • Consider running tsc --noEmit --pretty false and enabling incremental builds in your tsconfig for faster checks.
  • If commits often touch only docs or non-TS files, guard the tsc step (e.g., skip when no TS/TSX changes staged).
package.json (2)

17-18: Husky prepare script looks good; consider avoiding duplicate preview aliases

Adding "prepare": "husky" is correct. You now have both "preview" and "serve" doing vite preview. If both are intentional, all good; otherwise, consider keeping a single alias to reduce confusion.


42-43: Pin minimum Node version for Commitlint/Husky compatibility

@commitlint/*@^19 and husky@^9 require modern Node. Specify engines to prevent cryptic failures on older environments and align local/CI toolchains.

Add this to package.json (outside the shown hunk):

{
  "engines": {
    "node": ">=18.18.0 || >=20.0.0"
  },
  "packageManager": "npm@>=9 || pnpm@>=8 || yarn@>=3"
}

Ensure CI uses a compatible Node version (e.g., via setup-node) to avoid hook/commitlint failures.

Also applies to: 52-52

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0b22370 and c5f82c1.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .husky/commit-msg (1 hunks)
  • .husky/pre-commit (1 hunks)
  • commitlint.config.js (1 hunks)
  • package.json (3 hunks)
🔇 Additional comments (3)
commitlint.config.js (1)

1-1: LGTM: ESM config aligns with "type": "module"

Using export default with extends: ["@commitlint/config-conventional"] is correct for Commitlint v19 in an ESM project. No issues spotted.

package.json (2)

42-43: Dev tooling additions LGTM

Adding Commitlint CLI and conventional config is consistent with the new commit-msg hook.


52-52: Husky devDependency LGTM

husky@^9 pairs correctly with the prepare script you added.

@chmurson chmurson merged commit e840a16 into main Aug 22, 2025
7 of 8 checks passed
@chmurson chmurson deleted the add-husky branch August 22, 2025 09:57
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