diff --git a/src/rules/no-internal-modules.js b/src/rules/no-internal-modules.js index 687193f5c..5ed456547 100644 --- a/src/rules/no-internal-modules.js +++ b/src/rules/no-internal-modules.js @@ -58,16 +58,14 @@ module.exports = { } function toSteps(somePath) { - return normalizeSep(somePath) + return normalizeSep(somePath) .split('/') + .filter((step) => step && step !== '.') .reduce((acc, step) => { - if (!step || step === '.') { - return acc; - } else if (step === '..') { + if (step === '..') { return acc.slice(0, -1); - } else { - return acc.concat(step); } + return acc.concat(step); }, []); }