Skip to content

Commit 4392f46

Browse files
committed
fix: use Minimatch.match instead of minimatch to comply with Windows Native paths
1 parent 5db5ae5 commit 4392f46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/rules/no-restricted-paths.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path';
33
import resolve from 'eslint-module-utils/resolve';
44
import moduleVisitor from 'eslint-module-utils/moduleVisitor';
55
import isGlob from 'is-glob';
6-
import { Minimatch, default as minimatch } from 'minimatch';
6+
import { Minimatch } from 'minimatch';
77
import docsUrl from '../docsUrl';
88
import importType from '../core/importType';
99

@@ -83,7 +83,8 @@ module.exports = {
8383

8484
function isMatchingTargetPath(filename, targetPath) {
8585
if (isGlob(targetPath)) {
86-
return minimatch(filename, targetPath);
86+
const mm = new Minimatch(targetPath);
87+
return mm.match(filename);
8788
}
8889

8990
return containsPath(filename, targetPath);

0 commit comments

Comments
 (0)