eslint-plugin-no-relative-import-paths
Advanced tools
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", |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
6767