Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-path

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-path - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

12

lib/rules/no-relative-imports.js

@@ -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>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc