chore(lint): upgrade biome to v2.2.4 and fix all lint errors#857
chore(lint): upgrade biome to v2.2.4 and fix all lint errors#857
Conversation
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.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit 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. WalkthroughBiome 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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
!importantdeclarations 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 |
Deploying repomix with
|
| Latest commit: |
ea1cc48
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://21083438.repomix.pages.dev |
| Branch Preview URL: | https://chore-biome-update.repomix.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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[].typeto 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-Resetis present but non-numeric,new Date(NaN)is truthy andtoISOString()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
pathis imported.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis 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-ignoredirectives remain.
Found// @ts-expect-errorat 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
viimport aligns with Biome's noUnusedVariables rule that now adds underscore prefixes to unused variables to improve developer experience. Sinceviis 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
directoriesto_directoriescorrectly 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
keyto_keyis 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
openTokento_openTokencorrectly 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
toolHandlerhas 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
!importantfrom 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 verifiedbiome.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 checksucceeds. 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 signatureCan'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'
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
Checklist
npm run testnpm run lint