Skip to content

Commit

Permalink
always use posix path for normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Aug 8, 2017
1 parent 2657c65 commit 1c1f323
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rules/no-useless-path-segments.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function toRel(rel, sep) {
`.${sep}${stripped}`
}

function normalize(fn, sep) {
return toRel(path.normalize(fn), sep)
function normalize(fn) {
return toRel(path.posix.normalize(fn), '/')
}

const countRelParent = x => sumBy(x, v => v === '..')
Expand All @@ -44,7 +44,7 @@ module.exports = {
return
}

const normed = normalize(value, '/')
const normed = normalize(value)
if (normed !== value) {
return report(normed)
}
Expand Down

0 comments on commit 1c1f323

Please sign in to comment.