feat(check): support --no-error-on-unmatched-pattern for fmt and lint#1354
feat(check): support --no-error-on-unmatched-pattern for fmt and lint#1354
--no-error-on-unmatched-pattern for fmt and lint#1354Conversation
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
507a843 to
c9de266
Compare
08a95ab to
8e4d260
Compare
|
@cursor review |
There was a problem hiding this comment.
BTW, I suspect the output we're getting for now is NOT the intended behavior?
❯ vp check noop VITE+ - The Unified Toolchain for the Web error: Formatting could not start Checking formatting... Finished in 90ms on 0 files using 8 threads. No files found matching the given patterns. Formatting failed before analysis started pass: Found no warnings, lint errors, or type errors in 0 files (82ms, 8 threads)vp check [PATH] automatically set vp fmt --no-error-on-unmatched-pattern to surpress error, but it reports error.
Just wondering if this case also fixed?
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a82d5a0. Configure here.
a82d5a0 to
584373f
Compare
8e4d260 to
564d2c4
Compare
584373f to
81e3f01
Compare
564d2c4 to
5f44e05
Compare
81e3f01 to
2703014
Compare
5f44e05 to
27861db
Compare
27861db to
18f9f50
Compare
2703014 to
53e8b0f
Compare
53e8b0f to
10b0678
Compare
✅ Deploy Preview for viteplus-preview canceled.
|
|
@fengmk2 should be ready with 1.60.0! 🙏 |
In `--fix` mode with file paths, implicitly suppress "no matching files" errors for both fmt and lint. This fixes the lint-staged use case where staged files may be excluded by ignorePatterns (e.g. package-lock.json excluded by fmt ignorePatterns). Also expose `--no-error-on-unmatched-pattern` as an explicit CLI flag for non-fix use cases. oxfmt supports this flag natively; for oxlint (which does not), vp check handles it by treating unparseable lint output as a pass when the flag is active. Closes #1210
Invert the empty if-branch into a negated guard condition. Improve comments to explain the asymmetry between fmt and lint None arms: oxfmt handles the flag natively (exits 0), while oxlint does not (exits non-zero), requiring an explicit status override.
… is active Only suppress lint errors when the output is empty (no files to lint). If oxlint produced error output (config error, crash, etc.), surface it even when --no-error-on-unmatched-pattern is active.
…matched Add snap test that runs `vp check --fix` with paths (activating suppress_unmatched) on a file with a real lint error, confirming the error is still surfaced and the command exits non-zero.
Replace .oxlintrc.json with vite.config.ts in the check-fix-lint-error-not-swallowed snap test to match the preferred configuration style used across other snap tests.
10b0678 to
40a47e5
Compare
--no-error-on-unmatched-pattern flag--no-error-on-unmatched-pattern for fmt and lint
Now that oxlint supports --no-error-on-unmatched-pattern, pass it directly instead of working around it at the vp check level. Simplify the lint None branch to match the fmt pattern. Add snap tests for `vp check --fix package.json` (non-lintable file, should pass) and `vp lint package.json` (should exit non-zero).
40a47e5 to
7be8a79
Compare


Summary
--fixmode with file paths, implicitly pass--no-error-on-unmatched-patternto both oxfmt and oxlint, preventing errors when all staged files are excluded by ignorePatterns (the lint-staged use case).--no-error-on-unmatched-patternas an explicit CLI flag for non-fix use cases. Both oxfmt and oxlint support this flag natively.vp lint package.jsonexits non-zero.Closes #1210
Test plan
pnpm -F vite-plus snap-test-local check-fix-no-error-unmatched— verifies implicit/explicit flag behaviorpnpm -F vite-plus snap-test-local check-fix-lint-error-not-swallowed— verifies real lint errors surfacepnpm -F vite-plus snap-test-local lint-unmatched-pattern— verifiesvp lint package.jsonexits non-zeropnpm -F vite-plus snap-test-local check— all 25 check snap tests passpnpm -F vite-plus snap-test-global command-check-help— help output includes new flag