Skip to content

Pre-commit fails on Windows when path contains spaces (lint-staged + Biome argument splitting) #28971

@Shaizuu

Description

@Shaizuu

Issue Summary

Pre-commit hook fails on Windows when the user’s home directory contains spaces (e.g., C:/Users/First Middle Last/...).

When running git commit, lint-staged passes staged file paths to biome lint without proper quoting. On Windows, paths containing spaces are split into multiple arguments, causing Biome to receive invalid file paths and fail with "no files were processed".


Steps to Reproduce

  1. Use a Windows machine where the user directory contains spaces (e.g., C:/Users/First Middle Last/...)
  2. Clone the repository and install dependencies
  3. Modify and stage a file (e.g., git add file.tsx)
  4. Run git commit

Actual Results

  • The pre-commit hook runs lint-staged
  • lint-staged passes file paths with spaces to biome lint
  • The shell splits the path into multiple arguments
  • Biome receives invalid paths (e.g., First, Middle, Last/...)
  • Biome outputs: "no files were processed"
  • lint-staged exits with an error and reverts changes
  • The commit fails

Example:

git commit -m "message"
✔ Preparing lint-staged...
⚠ Running tasks for staged files...
❯ lint-staged.config.mjs — 2 files
❯ (apps|packages|companion)/**/*.{js,ts,jsx,tsx} — 2 files
✖ biome lint --reporter summary --config-path=biome-staged.json C:/Users/First Middle Last/Documents/cal.co…
↓ packages/prisma/schema.prisma — no files [SKIPPED]
↓ Skipped because of errors from tasks. [SKIPPED]
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...

✖ biome lint --reporter summary --config-path=biome-staged.json C:/Users/First Middle Last/Documents/cal.com/cal.com/apps/web/modules/ee/workflows/components/WorkflowStepContainer.tsx C:/Users/First Middle Last/Documents/cal.com/cal.com/packages/ui/components/form/checkbox/MultiSelectCheckboxes.tsx:
lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× No files were processed in the specified paths.

i Check your biome.json or biome.jsonc to ensure the paths are not ignored by the configuration.

i These paths were provided but ignored:

C:/Users/First
Middle
Last/Documents/cal.com/cal.com/apps/web/modules/ee/workflows/components/WorkflowStepContainer.tsx
C:/Users/First
Middle
Last/Documents/cal.com/cal.com/packages/ui/components/form/checkbox/MultiSelectCheckboxes.tsx

Checked 0 files in 5ms. No fixes applied.
husky - pre-commit script failed (code 1)


Expected Results

  • File paths passed to biome lint should be properly quoted or escaped
  • Biome should receive valid full file paths
  • Linting should run successfully on staged files
  • The commit should complete normally

Technical details

  • Browser: Brave v1.88.127
  • Operating System: Windows 11 Pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions