Skip to content

chore(lint): upgrade biome to v2.2.4 and fix all lint errors#857

Merged
yamadashy merged 2 commits intomainfrom
chore/biome-update
Sep 21, 2025
Merged

chore(lint): upgrade biome to v2.2.4 and fix all lint errors#857
yamadashy merged 2 commits intomainfrom
chore/biome-update

Conversation

@yamadashy
Copy link
Owner

Upgraded Biome linter from an older version to v2.2.4 and fixed all resulting lint errors across the codebase.

This update ensures we're using the latest linting rules and maintaining code quality standards. The changes include configuration updates and minor code adjustments to comply with the new linting rules.

Changes

  • Updated Biome to v2.2.4 in package.json
  • Updated biome.json configuration with new linting rules
  • Fixed lint errors across source files and tests
  • Updated website styles to comply with new CSS linting rules

Checklist

  • Run npm run test
  • Run npm run lint

Updated biome from v1.9.4 to v2.2.4 to take advantage of latest linting improvements.

- Upgraded @biomejs/biome from ^1.9.4 to ^2.2.4
- Updated biome.json configuration for v2 compatibility:
  - Changed schema to 2.2.4
  - Updated file includes/ignores syntax
  - Added Vue file overrides to disable noUnusedVariables/noUnusedImports
- Fixed all lint errors:
  - Added radix parameter to parseInt calls
  - Prefixed unused parameters with underscore
  - Removed unused imports
  - Fixed biome suppression comments
  - Removed !important from CSS
  - Added type ignores for Vue component definitions

All 325 files now pass lint with 0 warnings and 0 errors.
Copilot AI review requested due to automatic review settings September 21, 2025 04:46
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 21, 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.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Biome tooling upgraded to 2.2.4 with configuration migrated to the new schema and structure. Import organization control moved under assist actions; Vue-specific lint overrides added. Minor code/test cleanups rename unused parameters and add explicit parseInt radix. Small website theme CSS tweak and comment updates.

Changes

Cohort / File(s) Summary of Changes
Biome upgrade and config migration
biome.json, package.json
Updated @biomejs/biome to ^2.2.4; migrated config to $schema 2.2.4. Switched files include/ignore to includes with negations. Moved organizeImports to assist actions (off). Added Vue overrides disabling noUnusedVariables/Imports. Expanded formatter options (indentStyle, indentWidth, lineWidth).
CLI and core internals
src/cli/cliReport.ts, src/core/git/gitHubArchiveApi.ts, src/core/treeSitter/parseStrategies/GoParseStrategy.ts
Renamed unused params to underscored variants. Added radix 10 to Number.parseInt for rate limit reset parsing. No functional changes to control flow.
Config tests
tests/config/configLoad.test.ts
Replaced // @ts-ignore with // @ts-expect-error for invalid config case.
Core file permission tests
tests/core/file/permissionCheck.test.ts
Mock fs.access updated to ignore path param via underscore naming; behavior unchanged.
Output generation tests
tests/core/output/diffsInOutput.test.ts, tests/core/output/outputGenerateDiffs.test.ts
Mocks renamed first param to _config across cases; logic and expectations unchanged.
Integration tests
tests/integration-tests/packager.test.ts
Removed unused vi from vitest imports.
MCP tool tests
tests/mcp/tools/attachPackedOutputTool.test.ts, tests/mcp/tools/packCodebaseTool.test.ts, tests/mcp/tools/readRepomixOutputTool.test.ts
Minor formatting/type layout tweaks; renamed unused mock arg to underscore; no behavior changes.
Website client theme
website/client/.vitepress/theme/component.d.ts, website/client/.vitepress/theme/custom.css, website/client/.vitepress/theme/style.css
Adjusted lint suppression comments in d.ts. Reduced .cli-section h2 font-size from 2rem to 2rem (formatting normalization). Removed !important from --docsearch-primary-color assignment.
Website server utils
website/server/src/utils/errorHandler.ts
Renamed unused replacer param to _key in safeJSONStringify; behavior unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

dependencies

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "chore(lint): upgrade biome to v2.2.4 and fix all lint errors" accurately and concisely summarizes the primary change (upgrading the Biome linter) and the intent (fix lint errors), and it directly relates to the package.json and biome.json updates plus code fixes described in the changeset.
Description Check ✅ Passed The pull request description follows the repository template by providing a summary of changes, a "Changes" section that enumerates package and config updates and code adjustments, and a Checklist with the required test and lint items marked completed.

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant upgrade of the Biome linter to its latest version, v2.2.4. The primary goal is to enhance code quality and maintain consistency by leveraging updated linting rules. This involved not only updating the linter dependency and its configuration but also systematically fixing all newly reported lint errors across the project's source code, tests, and website styles, ensuring the codebase remains clean and compliant with current standards.

Highlights

  • Biome Upgrade: Updated the Biome linter from v1.9.4 to v2.2.4, incorporating the latest linting rules and features to enhance code quality.
  • Lint Error Resolution: Addressed and resolved all new linting errors introduced by the Biome upgrade across the entire codebase, including source files, tests, and website assets.
  • Configuration Refinement: Modified biome.json to align with the new schema, updated file inclusion/exclusion patterns, adjusted import organization settings, and added specific overrides for Vue files to disable certain unused variable/import rules.
  • Code Adjustments for Compliance: Applied minor code changes to comply with new linting rules, such as explicitly providing a radix to Number.parseInt and prefixing unused function parameters with an underscore.
  • Website Style Updates: Updated website CSS files to adhere to new CSS linting rules, including minor syntax corrections.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades the Biome linter from v1.9.4 to v2.2.4 and addresses all resulting lint violations to maintain code quality standards.

  • Upgraded Biome dependency to v2.2.4 with updated configuration schema
  • Fixed lint errors by prefixing unused function parameters with underscores
  • Removed unnecessary CSS !important declarations and cleaned up formatting

Reviewed Changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Updates Biome dependency to v2.2.4
biome.json Migrates configuration to new schema with updated file patterns and organize imports settings
website/server/src/utils/errorHandler.ts Prefixes unused parameter with underscore
website/client/.vitepress/theme/style.css Removes unnecessary !important declaration
website/client/.vitepress/theme/custom.css Removes unnecessary decimal zero
tests/mcp/tools/*.test.ts Collapses multi-line type definitions and prefixes unused parameters
tests/integration-tests/packager.test.ts Removes unused import
tests/core/output/*.test.ts Prefixes unused parameters with underscores
tests/core/file/permissionCheck.test.ts Prefixes unused parameters with underscores
tests/config/configLoad.test.ts Updates TypeScript comment directive
src/core/treeSitter/parseStrategies/GoParseStrategy.ts Prefixes unused parameter with underscore
src/core/git/gitHubArchiveApi.ts Adds radix parameter to parseInt
src/cli/cliReport.ts Prefixes unused parameter with underscore

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 21, 2025

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: ea1cc48
Status: ✅  Deploy successful!
Preview URL: https://21083438.repomix.pages.dev
Branch Preview URL: https://chore-biome-update.repomix.pages.dev

View logs

@codecov
Copy link

codecov bot commented Sep 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.66%. Comparing base (e28847c) to head (ea1cc48).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #857   +/-   ##
=======================================
  Coverage   87.66%   87.66%           
=======================================
  Files         109      109           
  Lines        6841     6841           
  Branches     1423     1423           
=======================================
  Hits         5997     5997           
  Misses        844      844           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully upgrades the Biome linter to v2.2.4 and applies the necessary code fixes to comply with the new linting rules. The changes are well-executed and improve overall code quality and maintainability. I've identified one potential issue in an error handling path that could lead to an application crash and have provided a suggestion to make the code more robust. Besides that, the changes look solid.

Added override configuration to disable Biome's organizeImports feature
specifically for src/index.ts to allow manual import order management
while keeping automatic import organization enabled for other files.
Copy link
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: 0

🧹 Nitpick comments (5)
tests/mcp/tools/readRepomixOutputTool.test.ts (1)

27-30: LGTM on reflow; consider narrowing the content type literal.

Change is fine. Optional: restrict content[].type to the known literal to catch typos at compile time.

-type ToolHandlerType = (args: { outputId: string; startLine?: number; endLine?: number }) => Promise<{
-  isError?: boolean;
-  content: Array<{ type: string; text: string }>;
-}>;
+type ToolHandlerType = (args: { outputId: string; startLine?: number; endLine?: number }) => Promise<{
+  isError?: boolean;
+  content: Array<{ type: 'text'; text: string }>;
+}>;
src/core/git/gitHubArchiveApi.ts (1)

82-85: Explicit radix is good; add a NaN guard to avoid RangeError on malformed headers.

If X-RateLimit-Reset is present but non-numeric, new Date(NaN) is truthy and toISOString() will throw. Guard the parse first.

-      const resetDate = resetTime ? new Date(Number.parseInt(resetTime, 10) * 1000) : null;
+      const parsed = resetTime != null ? Number.parseInt(resetTime, 10) : NaN;
+      const resetDate = Number.isFinite(parsed) ? new Date(parsed * 1000) : null;
website/client/.vitepress/theme/component.d.ts (1)

3-5: Vue declaration suppressions look fine; consider removing noBannedTypes via safer generics.

You can avoid the extra suppression by replacing {} with a precise, non-banned type and keeping only the noExplicitAny ignore.

Apply this diff:

-// biome-ignore lint/suspicious/noExplicitAny: Vue component
-// biome-ignore lint/complexity/noBannedTypes: Vue component type definition
-const component: DefineComponent<{}, {}, any>;
+// biome-ignore lint/suspicious/noExplicitAny: Vue component
+const component: DefineComponent<Record<string, never>, Record<string, never>, any>;
biome.json (1)

34-46: Vue overrides: pragmatic and aligned with typical SFC tooling.

Disabling noUnusedVariables/Imports for *.vue avoids false-positives with script/template boundaries.

If SFCs use TypeScript script setup consistently, consider selectively re‑enabling noUnusedImports and suppress per‑file only where needed to keep dead-code detection effective.

src/cli/cliReport.ts (1)

176-198: Use rootDir to print relative paths and sort skipped binary files.

Change the parameter to rootDir, sort binaryContentFiles for deterministic output, and print path.relative(rootDir, file.path).

-export const reportSkippedFiles = (_rootDir: string, skippedFiles: SkippedFileInfo[]) => {
-  const binaryContentFiles = skippedFiles.filter((file) => file.reason === 'binary-content');
+export const reportSkippedFiles = (rootDir: string, skippedFiles: SkippedFileInfo[]) => {
+  const binaryContentFiles = skippedFiles
+    .filter((file) => file.reason === 'binary-content')
+    .sort((a, b) => a.path.localeCompare(b.path, 'en'));
@@
-  binaryContentFiles.forEach((file, index) => {
-    logger.log(`${pc.white(`${index + 1}.`)} ${pc.white(file.path)}`);
+  binaryContentFiles.forEach((file, index) => {
+    const rel = path.relative(rootDir, file.path);
+    logger.log(`${pc.white(`${index + 1}.`)} ${pc.white(rel)}`);
   });

SkippedFileInfo is exported from src/core/file/workers/fileCollectWorker.ts — ensure the import in src/cli/cliReport.ts points to the correct module and that path is imported.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e28847c and f87e00d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (17)
  • biome.json (1 hunks)
  • package.json (1 hunks)
  • src/cli/cliReport.ts (1 hunks)
  • src/core/git/gitHubArchiveApi.ts (1 hunks)
  • src/core/treeSitter/parseStrategies/GoParseStrategy.ts (1 hunks)
  • tests/config/configLoad.test.ts (1 hunks)
  • tests/core/file/permissionCheck.test.ts (2 hunks)
  • tests/core/output/diffsInOutput.test.ts (1 hunks)
  • tests/core/output/outputGenerateDiffs.test.ts (4 hunks)
  • tests/integration-tests/packager.test.ts (1 hunks)
  • tests/mcp/tools/attachPackedOutputTool.test.ts (1 hunks)
  • tests/mcp/tools/packCodebaseTool.test.ts (1 hunks)
  • tests/mcp/tools/readRepomixOutputTool.test.ts (1 hunks)
  • website/client/.vitepress/theme/component.d.ts (1 hunks)
  • website/client/.vitepress/theme/custom.css (1 hunks)
  • website/client/.vitepress/theme/style.css (1 hunks)
  • website/server/src/utils/errorHandler.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
tests/core/output/diffsInOutput.test.ts (1)
src/core/output/outputGeneratorTypes.ts (1)
  • RenderContext (16-37)
tests/core/output/outputGenerateDiffs.test.ts (1)
src/core/output/outputGeneratorTypes.ts (1)
  • RenderContext (16-37)
src/cli/cliReport.ts (1)
src/core/file/workers/fileCollectWorker.ts (1)
  • SkippedFileInfo (16-19)
tests/mcp/tools/packCodebaseTool.test.ts (1)
src/cli/cliRun.ts (1)
  • runCli (208-259)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build and run with Bun (windows-latest, latest)
  • GitHub Check: Test (windows-latest, 20.x)
  • GitHub Check: Build and run (windows-latest, 20.x)
  • GitHub Check: Test with Bun (windows-latest, latest)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (19)
tests/config/configLoad.test.ts (1)

210-212: Good swap — verified: no active // @ts-ignore directives remain.
Found // @ts-expect-error at tests/config/configLoad.test.ts:210 and website/client/composables/usePackOptions.ts:38; src/types/git-url-parse.d.ts:9 only contains a documented mention of @ts-ignore (not a directive).

website/client/.vitepress/theme/custom.css (1)

27-27: LGTM! Minor font-size decimal improvement.

The font-size change from 2.0rem to 2rem aligns with Biome v2's stricter linting rules, which now emit different severities for style issues. This change maintains visual consistency while satisfying the linter requirements.

tests/integration-tests/packager.test.ts (1)

5-5: LGTM! Clean import optimization.

The removal of unused vi import aligns with Biome's noUnusedVariables rule that now adds underscore prefixes to unused variables to improve developer experience. Since vi is not used in this test file, removing it is the correct approach.

tests/mcp/tools/packCodebaseTool.test.ts (1)

65-65: LGTM! Proper unused parameter handling.

The parameter rename from directories to _directories correctly follows Biome's convention for marking unused parameters to improve developer experience while typing and saving. This is a clean solution that maintains the mock's functionality while satisfying the linter.

website/server/src/utils/errorHandler.ts (1)

44-44: LGTM! Consistent unused parameter naming.

The parameter rename from key to _key is consistent with the broader pattern in this PR of prefixing unused parameters with underscores. The function logic remains unchanged and the parameter is correctly unused in the replacer function.

src/core/treeSitter/parseStrategies/GoParseStrategy.ts (1)

124-124: LGTM! Proper unused parameter handling in private method.

The parameter rename from openToken to _openToken correctly indicates that this parameter is unused in the method implementation. This maintains the method signature while clearly marking the unused parameter, consistent with the broader PR pattern.

tests/mcp/tools/attachPackedOutputTool.test.ts (1)

26-26: LGTM! Clean type annotation formatting.

The type annotation for toolHandler has been formatted to a single line, improving readability. The functionality and type definition remain unchanged.

website/client/.vitepress/theme/style.css (1)

129-129: LGTM! Removed unnecessary CSS important flag.

The removal of !important from the CSS custom property assignment improves specificity handling and allows for better cascade behavior. This change aligns with CSS best practices and the updated linting rules.

package.json (1)

107-107: Biome v2.2.4 upgrade compatibility verified

biome.json uses the v2 schema (https://biomejs.dev/schemas/2.2.4/schema.json); assist.actions.source.organizeImports is present and set to "off" (line 27); linter enabled with recommended rules; npx biome check succeeds. No further changes required.

tests/core/file/permissionCheck.test.ts (2)

48-54: LGTM: unused param renamed to _path in mock.

Clearer intent without changing behavior.


204-209: LGTM: consistent unused param naming in write-only failure mock.

Matches the pattern used elsewhere in the suite.

tests/core/output/outputGenerateDiffs.test.ts (3)

74-80: LGTM: mock signature updated to ignore config arg.

No behavioral change; keeps assertions focused on RenderContext.


142-149: LGTM: same unused-arg rename for markdown template mock.

Consistent with XML/plain cases.


220-226: LGTM: unused-arg rename in “diffs disabled” path.

Maintains clarity without affecting expectations.

biome.json (4)

47-53: Formatter settings increase lineWidth to 120; OK.

No concerns; watch for long template literals in docs.


27-27: Confirmed: assist.actions.source.organizeImports set to "off" is the correct Biome 2.2.x setting to disable import organization. No changes needed.


4-25: Confirmed — Biome 2.2.4 supports negated globs in files.includes. Negations starting with "!" (e.g. "!**/dist") are valid, act as exceptions, and do not require a separate exclusion key; patterns are processed in order.


2-2: Approve — schema bump to 2.2.4 verified
biome.json schema is 2.2.4 and package.json devDependency @biomejs/biome is "^2.2.4".

tests/core/output/diffsInOutput.test.ts (1)

176-180: LGTM — Handlebars mock rename OK; confirm generateHandlebarOutput signature

Can't locate generateHandlebarOutput implementation in the repo; confirm its exported signature so tests fail fast on changes.
Test: tests/core/output/diffsInOutput.test.ts:176-180
Run locally: rg -n --hidden -S 'generateHandlebarOutput' -g '!node_modules' || git grep -n 'generateHandlebarOutput'

@yamadashy yamadashy merged commit 61719eb into main Sep 21, 2025
48 checks passed
@yamadashy yamadashy deleted the chore/biome-update branch September 21, 2025 04:58
@coderabbitai coderabbitai bot mentioned this pull request Nov 26, 2025
2 tasks
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