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

eslint-plugin-no-relative-import-paths

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-relative-import-paths - npm Package Compare versions

Comparing version 1.5.2 to 1.5.3

18

index.js
const path = require("path");
function isParentFolder(relativeFilePath, context, rootDir) {
const absoluteRootPath = context.getCwd() + (rootDir !== '' ? path.sep + rootDir : '');
const absoluteRootPath = path.join(context.getCwd(), rootDir);
const absoluteFilePath = path.join(path.dirname(context.getFilename()), relativeFilePath)

@@ -10,3 +10,3 @@

(absoluteFilePath.startsWith(absoluteRootPath) &&
context.getFilename().startsWith(absoluteRootPath))
context.getFilename().startsWith(absoluteRootPath))
);

@@ -23,7 +23,7 @@ }

...path
.relative(
context.getCwd() + (rootDir !== '' ? path.sep + rootDir : ''),
path.join(path.dirname(context.getFilename()), relativePath)
)
.split(path.sep)
.relative(
path.join(context.getCwd(), rootDir),
path.join(path.dirname(context.getFilename()), relativePath)
)
.split(path.sep)
].filter(String).join("/");

@@ -58,3 +58,3 @@ }

[node.source.range[0] + 1, node.source.range[1] - 1],
getAbsolutePath(path, context, rootDir || '', prefix)
getAbsolutePath(path, context, rootDir, prefix)
);

@@ -72,3 +72,3 @@ },

[node.source.range[0] + 1, node.source.range[1] - 1],
getAbsolutePath(path, context, rootDir || '', prefix)
getAbsolutePath(path, context, rootDir, prefix)
);

@@ -75,0 +75,0 @@ },

{
"name": "eslint-plugin-no-relative-import-paths",
"version": "v1.5.2",
"version": "v1.5.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

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