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.2.2 to 1.2.3

20

lib/rules/no-relative-imports.js

@@ -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 (

2

package.json
{
"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>",

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