eslint-plugin-module-resolver
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -61,3 +61,3 @@ "use strict"; | ||
var newPath = resolvedPath.replace(aliasPath, ''); | ||
var replacement = path.normalize(path.join(aliasMatch, newPath)); | ||
var replacement = path.normalize(path.join(aliasMatch, newPath)).replace(/\\/g, '/').replace(/\/c:/gi, ''); | ||
return function (fixer) { | ||
@@ -64,0 +64,0 @@ return fixer.replaceTextRange([source.range[0] + 1, source.range[1] - 1], replacement); |
"use strict"; | ||
var path = require('path'); | ||
function isAliasPath(resolvedPath, aliasPath) { | ||
// Prevent replacing the path mid-word | ||
return resolvedPath.endsWith(aliasPath) || resolvedPath.includes("".concat(aliasPath, "/")); | ||
return resolvedPath.endsWith(aliasPath) || resolvedPath.includes("".concat(aliasPath).concat(path.sep)); | ||
} | ||
module.exports = isAliasPath; |
{ | ||
"name": "eslint-plugin-module-resolver", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Warn when using relative paths to modules aliased", | ||
@@ -5,0 +5,0 @@ "repository": "HeroProtagonist/eslint-plugin-module-resolver", |
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
22572
342