Skip to content

fix(root): exclude libs/internal-sdk from lint-staged biome formatting#10655

Merged
LetItRock merged 1 commit intonextfrom
cursor/exclude-internal-sdk-from-lint-staged-44aa
Apr 13, 2026
Merged

fix(root): exclude libs/internal-sdk from lint-staged biome formatting#10655
LetItRock merged 1 commit intonextfrom
cursor/exclude-internal-sdk-from-lint-staged-44aa

Conversation

@LetItRock
Copy link
Copy Markdown
Contributor

@LetItRock LetItRock commented Apr 10, 2026

What changed

When there's a merge conflict involving libs/internal-sdk (auto-generated code), the lint-staged pre-commit hook was running biome formatting on those files. This caused unwanted formatting changes to appear in PRs, since biome reformats the auto-generated code (e.g., changing double quotes to single quotes).

While biome.json already excludes libs/internal-sdk via files.includes, this exclusion is bypassed when lint-staged passes explicit file paths as CLI arguments to biome.

How it's fixed

  • Moved the lint-staged configuration from package.json to a new .lintstagedrc.js file
  • Used a function-based pattern that filters out any files matching /internal-sdk/ before passing them to biome
  • When only internal-sdk files are staged, no biome command runs at all

Testing

Verified locally that:

  1. Staging an internal-sdk file and running lint-staged does not run biome on it (formatting is preserved)
  2. Staging a normal file still runs biome formatting as expected
  3. Mixed staging (internal-sdk + normal files) correctly filters out only the internal-sdk files

Slack Thread

Open in Web Open in Cursor 

What changed

Moved lint-staged configuration from package.json to a new .lintstagedrc.js file with added filtering logic. The configuration now excludes files matching /internal-sdk/ (auto-generated code) before passing them to biome for formatting. This prevents biome from reformatting auto-generated files that should not be modified.

Affected areas

root: Lint-staged configuration moved to .lintstagedrc.js with filtering to skip internal-sdk files during pre-commit formatting checks.

Key technical decisions

  • Migrated from package.json inline config to a dedicated .lintstagedrc.js file using a function-based pattern to filter staged files before passing to biome, allowing dynamic exclusion logic that bypasses the limitation of biome.json file exclusions when explicit file paths are provided via CLI.

Testing

Manual verification confirmed:

  1. Staging an internal-sdk file does not run biome formatting on it.
  2. Staging normal files still runs biome formatting as expected.
  3. Mixed staging of internal-sdk and normal files correctly filters out only internal-sdk files before running biome.

Move lint-staged config to .lintstagedrc.js to use a function-based
pattern that filters out libs/internal-sdk files before passing them
to biome. This prevents biome from reformatting auto-generated SDK
code when it appears in staged files (e.g. after merge conflicts),
which previously caused unwanted formatting changes in PRs.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

This PR migrates lint-staged configuration from package.json to a dedicated .lintstagedrc.js file, maintaining the same linting rules for test files and source code files while excluding internal SDK paths.

Changes

Cohort / File(s) Summary
Configuration Migration
.lintstagedrc.js, package.json
Moved lint-staged configuration from package.json to a new .lintstagedrc.js file. Rules remain unchanged: stop-only --file for e2e/spec test files, and biome check --write --no-errors-on-unmatched --diagnostic-level=error for TS/JS/JSON files (excluding /internal-sdk/ paths).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested labels

CI/CD

Suggested reviewers

  • scopsy
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title follows Conventional Commits format with valid type 'fix' and scope 'root', uses lowercase imperative mood for description, and clearly summarizes the main change of filtering internal-sdk files from lint-staged biome formatting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 10, 2026

Deploy Preview for dashboard-v2-novu-staging canceled.

Name Link
🔨 Latest commit 728b7e0
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/69d911c5d0d81d000888c0ad

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

Hey there and thank you for opening this pull request! 👋

We require pull request titles to follow specific formatting rules and it looks like your proposed title needs to be adjusted.

Your PR title is: fix(root): exclude libs/internal-sdk from lint-staged biome formatting

Requirements:

  1. Follow the Conventional Commits specification
  2. As a team member, include Linear ticket ID at the end: fixes TICKET-ID or include it in your branch name

Expected format: feat(scope): Add fancy new feature fixes NOV-123

Details:

PR title must end with 'fixes TICKET-ID' (e.g., 'fixes NOV-123') or include ticket ID in branch name

@LetItRock LetItRock self-assigned this Apr 13, 2026
@LetItRock LetItRock marked this pull request as ready for review April 13, 2026 11:47
Copy link
Copy Markdown
Contributor

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.lintstagedrc.js:
- Around line 3-8: The lint-staged rule currently filters files using
files.filter((file) => !file.includes('/internal-sdk/')) which is too broad;
update the filter to precisely match the biome.json exclusion by checking for
the specific path segment used there (e.g., 'libs/internal-sdk') so that only
files under that exact directory are skipped. Locate the filtered variable and
the files.filter callback in .lintstagedrc.js and replace the
includes('/internal-sdk/') check with a stricter check that matches the biome
scope (for example using file.includes('libs/internal-sdk') or a
path-segment-aware test). Ensure the rest of the function returns the same biome
command when filtered is non-empty.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 223540e7-5b2a-4fa3-a192-fc195c2d1a44

📥 Commits

Reviewing files that changed from the base of the PR and between 383a955 and 728b7e0.

📒 Files selected for processing (2)
  • .lintstagedrc.js
  • package.json
💤 Files with no reviewable changes (1)
  • package.json

@LetItRock LetItRock enabled auto-merge (squash) April 13, 2026 12:01
@LetItRock LetItRock disabled auto-merge April 13, 2026 12:01
@LetItRock LetItRock merged commit 5de6ee7 into next Apr 13, 2026
33 checks passed
@LetItRock LetItRock deleted the cursor/exclude-internal-sdk-from-lint-staged-44aa branch April 13, 2026 12:01
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.

2 participants