Skip to content

fix: skip lint-staged failure when only ignored files are staged - #78

Merged
bhouston merged 1 commit into
mainfrom
fix/77-lint-staged-unmatched-pattern
Sep 28, 2026
Merged

bhouston merged 1 commit into
mainfrom
fix/77-lint-staged-unmatched-pattern

Conversation

@bhouston

Copy link
Copy Markdown
Owner

Summary

  • Add --no-error-on-unmatched-pattern to the oxfmt and oxlint --fix invocations in the lint-staged block of package.json (JS/TS entry and the json/md/yaml oxfmt entry).
  • Fixes a false-positive commit failure when the only staged file matching a glob is one excluded by oxfmt/oxlint ignore rules (e.g. a generated routeTree.gen.ts), since both tools then see zero matched files and exit non-zero.

Closes #77

Test plan

  • git commit on this branch (staging only package.json) ran the pre-commit hook successfully with the new flag.
  • Reviewer: stage only an oxfmt/oxlint-ignored generated file and confirm commit no longer fails.

Add --no-error-on-unmatched-pattern to the oxfmt and oxlint --fix
invocations in the lint-staged config so staging only a generated or
otherwise ignored file (e.g. routeTree.gen.ts) no longer fails the
commit when both tools end up with zero matched files.

Refs #77
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bhouston
bhouston merged commit 685ea93 into main Sep 28, 2026
2 checks passed
@bhouston
bhouston deleted the fix/77-lint-staged-unmatched-pattern branch September 28, 2026 13:17
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.

fix: lint-staged fails when only generated files are staged

2 participants