fix(formatter): honor equivalent Windows home paths

This commit is contained in:
Afloat committed 2026-11-17 14:04:49 +08:00
1 parent 69bbf04bc7
commit e9300358da
2 files changed
+24 -1

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@ function findProjectRoot(startDir) {
while (dir !== path.dirname(dir)) {
// Stop before checking the home directory to avoid treating global
// dotfiles (e.g. ~/.prettierrc) as a project root marker.
if (dir === homeDir) break;
if (path.relative(homeDir, dir) === '') break;
if (detectFormatter(dir)) {
projectRootCache.set(startDir, dir);
return dir;