@@ -331,6 +331,10 @@ func getAllTypeScriptEslintPluginRules() []rule.Rule {
331
331
return rules
332
332
}
333
333
334
+ func pathMatch (pattern , name string ) (bool , error ) {
335
+ return doublestar .PathMatch (filepath .ToSlash (pattern ), filepath .ToSlash (name ))
336
+ }
337
+
334
338
// isFileIgnored checks if a file should be ignored based on ignore patterns
335
339
func isFileIgnored (filePath string , ignorePatterns []string ) bool {
336
340
// Get current working directory for relative path resolution
@@ -345,21 +349,21 @@ func isFileIgnored(filePath string, ignorePatterns []string) bool {
345
349
346
350
for _ , pattern := range ignorePatterns {
347
351
// Try matching against normalized path
348
- if matched , err := doublestar . PathMatch (pattern , normalizedPath ); err == nil && matched {
352
+ if matched , err := pathMatch (pattern , normalizedPath ); err == nil && matched {
349
353
return true
350
354
}
351
355
352
356
// Also try matching against original path for absolute patterns
353
357
if normalizedPath != filePath {
354
- if matched , err := doublestar . PathMatch (pattern , filePath ); err == nil && matched {
358
+ if matched , err := pathMatch (pattern , filePath ); err == nil && matched {
355
359
return true
356
360
}
357
361
}
358
362
359
363
// Try Unix-style path for cross-platform compatibility
360
364
unixPath := strings .ReplaceAll (normalizedPath , "\\ " , "/" )
361
365
if unixPath != normalizedPath {
362
- if matched , err := doublestar . PathMatch (pattern , unixPath ); err == nil && matched {
366
+ if matched , err := pathMatch (pattern , unixPath ); err == nil && matched {
363
367
return true
364
368
}
365
369
}
@@ -387,7 +391,7 @@ func normalizePath(filePath, cwd string) string {
387
391
// isFileIgnoredSimple provides fallback matching when cwd is unavailable
388
392
func isFileIgnoredSimple (filePath string , ignorePatterns []string ) bool {
389
393
for _ , pattern := range ignorePatterns {
390
- if matched , err := doublestar . PathMatch (pattern , filePath ); err == nil && matched {
394
+ if matched , err := pathMatch (pattern , filePath ); err == nil && matched {
391
395
return true
392
396
}
393
397
}
0 commit comments