@@ -323,6 +323,10 @@ func getAllTypeScriptEslintPluginRules() []rule.Rule {
323
323
return rules
324
324
}
325
325
326
+ func pathMatch (pattern , name string ) (bool , error ) {
327
+ return doublestar .PathMatch (filepath .ToSlash (pattern ), filepath .ToSlash (name ))
328
+ }
329
+
326
330
// isFileIgnored checks if a file should be ignored based on ignore patterns
327
331
func isFileIgnored (filePath string , ignorePatterns []string ) bool {
328
332
// Get current working directory for relative path resolution
@@ -337,21 +341,21 @@ func isFileIgnored(filePath string, ignorePatterns []string) bool {
337
341
338
342
for _ , pattern := range ignorePatterns {
339
343
// Try matching against normalized path
340
- if matched , err := doublestar . PathMatch (pattern , normalizedPath ); err == nil && matched {
344
+ if matched , err := pathMatch (pattern , normalizedPath ); err == nil && matched {
341
345
return true
342
346
}
343
347
344
348
// Also try matching against original path for absolute patterns
345
349
if normalizedPath != filePath {
346
- if matched , err := doublestar . PathMatch (pattern , filePath ); err == nil && matched {
350
+ if matched , err := pathMatch (pattern , filePath ); err == nil && matched {
347
351
return true
348
352
}
349
353
}
350
354
351
355
// Try Unix-style path for cross-platform compatibility
352
356
unixPath := strings .ReplaceAll (normalizedPath , "\\ " , "/" )
353
357
if unixPath != normalizedPath {
354
- if matched , err := doublestar . PathMatch (pattern , unixPath ); err == nil && matched {
358
+ if matched , err := pathMatch (pattern , unixPath ); err == nil && matched {
355
359
return true
356
360
}
357
361
}
@@ -379,7 +383,7 @@ func normalizePath(filePath, cwd string) string {
379
383
// isFileIgnoredSimple provides fallback matching when cwd is unavailable
380
384
func isFileIgnoredSimple (filePath string , ignorePatterns []string ) bool {
381
385
for _ , pattern := range ignorePatterns {
382
- if matched , err := doublestar . PathMatch (pattern , filePath ); err == nil && matched {
386
+ if matched , err := pathMatch (pattern , filePath ); err == nil && matched {
383
387
return true
384
388
}
385
389
}
0 commit comments