eslint-plugin-path
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -39,10 +39,22 @@ "use strict"; | ||
return (path.split("/").length || 1) - 1; | ||
return (path.split(/[\\/]/).length || 1) - 1; | ||
} | ||
/** | ||
* Replace all backslashes (\) with forward slashes (/) | ||
* @param {string} path | ||
* @returns {string} - path with forward slashes | ||
*/ | ||
function replaceBlackSlashesWithForward(path) { | ||
if (!path) { | ||
return ""; | ||
} | ||
return path.replace(/\\/g, "/"); | ||
} | ||
/** | ||
* Checks if the max path depth has been exceeded | ||
* @param {string} current | ||
* @param {RuleSettings} settings | ||
* @returns | ||
* @returns {boolean} - true if max depth exceeded | ||
*/ | ||
@@ -85,3 +97,5 @@ function isMaxDepthExceeded(current, settings) { | ||
const expected = getAbsolutePathToTarget(path, tsconfigSettings); | ||
const expected = replaceBlackSlashesWithForward( | ||
getAbsolutePathToTarget(path, tsconfigSettings) | ||
); | ||
@@ -88,0 +102,0 @@ if ( |
{ | ||
"name": "eslint-plugin-path", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"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
15177
409