Skip to content

Commit e8954db

Browse files
1petebenmosher
authored andcommitted
make rule no-relative-parent-imports support windows (#1141)
1 parent e3a03de commit e8954db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/importType.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function isInternalModule(name, settings, path) {
5757
}
5858

5959
function isRelativeToParent(name) {
60-
return name.indexOf('../') === 0
60+
return /^\.\.[\\/]/.test(name)
6161
}
6262

6363
const indexFiles = ['.', './', './index', './index.js']
@@ -66,7 +66,7 @@ function isIndex(name) {
6666
}
6767

6868
function isRelativeToSibling(name) {
69-
return name.indexOf('./') === 0
69+
return /^\.[\\/]/.test(name)
7070
}
7171

7272
const typeTest = cond([

0 commit comments

Comments
 (0)