Skip to content

git commit提交代码被Biome lint拦截 #45

@AgentArc

Description

@AgentArc

使用git commit提交代码时,被Biome lint拦截,报大量错误

以下省略了很多

Running Biome lint on staged files...
src\cli\exit.ts:20:3 suppressions/unused ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule.

18 │ /** Write an error message to stderr (if given) and exit with code 1. */
19 │ export function cliError(msg?: string): never {

20 │ // biome-ignore lint/suspicious/noConsole: centralized CLI error output
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 │ if (msg) console.error(msg)
22 │ process.exit(1)

src\services\mcp_tests_\envExpansion.test.ts:44:35 lint/suspicious/noTemplateCurlyInString ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! Unexpected template string placeholder.

42 │     delete process.env.MISSING;
43 │     const result = expandEnvVarsInString("${MISSING}");

44 │ expect(result.expanded).toBe("${MISSING}");
│ ^^^^^^^^^^
45 │ expect(result.missingVars).toEqual(["MISSING"]);
46 │ });

i Turn the string into a template string.

src\utils\ansiToPng.ts:178:3 lint/complexity/useSimpleNumberKeys FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! Hexadecimal number literal is not allowed here.

176 │   0x2592: 0.5, // ▒
177 │   0x2593: 0.75, // ▓

178 │ 0x2588: 1.0, // █
│ ^^^^^^
179 │ }
180 │

i Safe fix: Replace 0x2588 with 9608

176 176 │     0x2592: 0.5, // ▒␍
177 177 │     0x2593: 0.75, // ▓␍
178     │ - ··0x2588:·1.0,·//·█␍
    178 │ + ··9608:·1.0,·//·█␍
179 179 │   }␍
180 180 │   ␍

src\utils\auth.ts:516:5 suppressions/unused ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule.

514 │     if (epoch !== _apiKeyHelperEpoch) return ' '
515 │     const detail = e instanceof Error ? e.message : String(e)

516 │ // biome-ignore lint/suspicious/noConsole: user-configured script failed; must be visible without --debug
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
517 │ console.error(chalk.red(apiKeyHelper failed: ${detail}))
518 │ logForDebugging(Error getting API key from apiKeyHelper: ${detail}, {

The number of diagnostics exceeds the limit allowed. Use --max-diagnostics to increase it.
Diagnostics not shown: 54.
Checked 620 files in 650ms. No fixes applied.
Found 7 errors.
Found 32 warnings.
Found 35 infos.
lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Some errors were emitted while running checks.

src\utils\telemetry\instrumentation.ts:713:21 lint/correctness/useParseIntRadix FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Missing radix parameter

711 │   }
712 │

713 │ const timeoutMs = parseInt(
│ ^^^^^^^^^
714 │ process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS || '5000',
715 │ )
│ ^
716 │
717 │ try {

i Add a non-fractional number between 2 and 36

i Unsafe fix: Add a radix of 10

714 │ ····process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS·||·'5000',·10␍
    │                                                             +++

src\utils\worktree.ts:1386:5 suppressions/unused ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule.

1384 │   if (useControlMode && !sessionExists) {
1385 │     const y = chalk.yellow

1386 │ // biome-ignore lint/suspicious/noConsole: intentional user guidance
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1387 │ console.log(
1388 │ \n${y('╭─ iTerm2 Tip ────────────────────────────────────────────────────────╮')}\n +

Checked 106 files in 116ms. No fixes applied.
Found 6 warnings.
Found 6 infos.

Biome lint failed. Fix errors or use --no-verify to bypass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions