eslint-plugin-path
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -15,13 +15,13 @@ "use strict"; | ||
* @param {Array<AliasItem>} aliases | ||
* @returns {string|null} - absolute path import | ||
* @returns {string} - absolute path import | ||
*/ | ||
function getAbsolutePathToTarget(target, aliases = []) { | ||
if (!target || !aliases) { | ||
return null; | ||
return ""; | ||
} | ||
const absolutePath = aliases | ||
.map(({ path, alias }) => `${alias || ""}${relative(path, target)}`) | ||
.find((path) => !isRelativeToParent(path)); | ||
.filter((path) => !isRelativeToParent(path) && path.indexOf("..") === -1); | ||
return absolutePath || null; | ||
return (absolutePath && absolutePath[0]) || ""; | ||
} | ||
@@ -59,4 +59,4 @@ | ||
* Checks if the current import is incorrect as expected | ||
* @param {string} current | ||
* @param {string} expected | ||
* @param {?string} current | ||
* @param {?string} expected | ||
* @param {RuleSettings} settings | ||
@@ -63,0 +63,0 @@ * @returns |
{ | ||
"name": "eslint-plugin-path", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "author": "qDanik <qdanik@yandex.ru>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14726