Skip to content

fix(uncheck): reject paths outside cwd, take existing exclusions literally, skip linked folders - #20

Merged
dinwwwh merged 1 commit into
mainfrom
claude/focused-cohen-f69cbf
Oct 1, 2026
Merged

dinwwwh merged 1 commit into
mainfrom
claude/focused-cohen-f69cbf

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Oct 1, 2026

Copy link
Copy Markdown
Member

Fixes three path-resolution bugs in uncheck <paths>. A path above the working directory now fails with a clear error instead of a tool error and a misleading "rerun with --fix" hint. Excluding a route file like [id].ts no longer drops i.ts and d.ts too. A linked folder in a git project is no longer checked through the link.

Fixes

  • A file, folder, glob or absolute path outside cwd fails with <path> is outside <cwd>, run from a folder that contains it or pass one with --cwd. This also applies with --no-error-on-unmatched-pattern. Before, a file reached oxlint and oxfmt as ../..., which they reject, and a folder or glob gave "No files match".
  • An exclusion that names an existing file or folder leaves out that path alone, the same way includes already work. If the path doesn't exist, the exclusion is still read as a glob. \[id\].ts escapes now work on Linux and macOS.
  • Linked folders, which git lists as a single file, are no longer passed to the tools. Their files are reported once, --fix no longer edits through a link that points outside the repo, and git and non-git projects now resolve the same files. Linked files are still checked, and broken links are still dropped.

Behavior change

Running uncheck --only=tsc ../core/src/index.ts from packages/app used to build app through its project references. It now hits the outside-cwd error. In a default run it already failed, because oxlint and oxfmt reject the path. Running the same command from the workspace root still builds every dependent package and is still tested.

Testing

  • New e2e tests in both layouts: ../ paths from a subfolder and via --cwd, glob-named and escaped exclusions, and a git project with linked folders inside and outside the repo, a linked file and a broken link.
  • Each new test fails on the previous code. The full suite passes at 100% coverage.

…rally, skip linked folders

- A file, folder or glob above the working directory now fails with a clear
  error instead of reaching oxlint and oxfmt as a "../" path they reject.
- An exclusion naming an existing path leaves out that path alone, so
  `![id].ts` no longer also drops i.ts and d.ts; backslash escapes now reach
  the glob matcher on POSIX.
- Linked folders, which git lists as one file, are no longer handed to the
  tools, so their files are not reported twice or fixed outside the repo.
@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/uncheck@20

commit: cda00cd

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Outside-cwd rejection. Each include whose resolved target is .., ../…, or absolute now fails fast with a clear CliError.UserError before reaching oxlint/oxfmt, including under --no-error-on-unmatched-pattern.
  • Backslash stays an escape. relative() swaps .replaceAll('\\', '/') for .split(path.sep).join('/'), so \[id\].ts is a glob escape on POSIX while Windows separators are still normalized.
  • Exclusions take an existing path literally. A !pattern naming an existing file/folder matches only that path (and its subtree); a non-existent one is still read as a glob, mirroring includes.
  • Linked folders and broken links are dropped. The final filter moved from existsSync to a statSync().isFile() helper, so git's single symlink entry for a linked folder is no longer passed through to the tools. Symlinks to files are still checked.

I verified the new tests are real regressions: reverting only packages/uncheck/src/files.ts to the base makes them fail (linked folder leaks into oxlint output, the escaped-glob include reports "No files match", and ../legacy.ts reaches oxlint instead of erroring). All five changed test files pass against the PR.

The documented behavior change — --only=tsc ../core/src/index.ts from a package now hits the outside-cwd error rather than building referencing projects — is a reasonable fail-fast tradeoff and the workspace-root run is still covered. One non-blocking note: the README's "Check only some files" section still frames unmatched patterns as the only failure mode, so it could mention that an out-of-cwd path errors regardless of --no-error-on-unmatched-pattern.

Pullfrog  | View workflow run | Using DeepSeek Flash (default — pick a model for stronger reviews) | 𝕏

@dinwwwh
dinwwwh merged commit 4f31897 into main Oct 1, 2026
7 checks passed
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant