@@ -303,8 +303,10 @@ func hasRootMarkers(dir string, markers []string) bool {
303 return true
303 return true
305 for _, pattern := range markers {
305 for _, pattern := range markers {
306− // Use fsext.GlobWithDoubleStar to find matches
306+ // Use filepath.Glob for a non-recursive check in the root
307− matches, _, err := fsext.Glob(pattern, dir, 1)
307+ // directory. This avoids walking the entire tree (which is
308+ // catastrophic in large monorepos with node_modules, etc.).
309+ matches, err := filepath.Glob(filepath.Join(dir, pattern))
308 if err == nil && len(matches) > 0 {
310 if err == nil && len(matches) > 0 {
309 return true
311 return true