@@ -307,6 +307,10 @@ func getAllTypeScriptEslintPluginRules() []rule.Rule {
307
307
return rules
308
308
}
309
309
310
+ func pathMatch (pattern , name string ) (bool , error ) {
311
+ return doublestar .PathMatch (filepath .ToSlash (pattern ), filepath .ToSlash (name ))
312
+ }
313
+
310
314
// isFileIgnored checks if a file should be ignored based on ignore patterns
311
315
func isFileIgnored (filePath string , ignorePatterns []string ) bool {
312
316
// Get current working directory for relative path resolution
@@ -321,21 +325,21 @@ func isFileIgnored(filePath string, ignorePatterns []string) bool {
321
325
322
326
for _ , pattern := range ignorePatterns {
323
327
// Try matching against normalized path
324
- if matched , err := doublestar . PathMatch (pattern , normalizedPath ); err == nil && matched {
328
+ if matched , err := pathMatch (pattern , normalizedPath ); err == nil && matched {
325
329
return true
326
330
}
327
331
328
332
// Also try matching against original path for absolute patterns
329
333
if normalizedPath != filePath {
330
- if matched , err := doublestar . PathMatch (pattern , filePath ); err == nil && matched {
334
+ if matched , err := pathMatch (pattern , filePath ); err == nil && matched {
331
335
return true
332
336
}
333
337
}
334
338
335
339
// Try Unix-style path for cross-platform compatibility
336
340
unixPath := strings .ReplaceAll (normalizedPath , "\\ " , "/" )
337
341
if unixPath != normalizedPath {
338
- if matched , err := doublestar . PathMatch (pattern , unixPath ); err == nil && matched {
342
+ if matched , err := pathMatch (pattern , unixPath ); err == nil && matched {
339
343
return true
340
344
}
341
345
}
@@ -363,7 +367,7 @@ func normalizePath(filePath, cwd string) string {
363
367
// isFileIgnoredSimple provides fallback matching when cwd is unavailable
364
368
func isFileIgnoredSimple (filePath string , ignorePatterns []string ) bool {
365
369
for _ , pattern := range ignorePatterns {
366
- if matched , err := doublestar . PathMatch (pattern , filePath ); err == nil && matched {
370
+ if matched , err := pathMatch (pattern , filePath ); err == nil && matched {
367
371
return true
368
372
}
369
373
}
0 commit comments