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

eslint-plugin-disallow-cross-domain-imports

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-disallow-cross-domain-imports - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

lib/index.js

@@ -17,2 +17,2 @@ /**

module.exports.rules = requireIndex(__dirname + "/rules", ['no-cross-imports']);
module.exports.rules = requireIndex(__dirname + "/rules");

@@ -44,11 +44,11 @@ /**

const filePath = context.getPhysicalFilename()
// const filePath = 'test'
const importPath = node.source.value
// context.options
// ['error', {disallowedPaths: ['../userprofile', 'userprofile/subfolder'], domain: 'userprofile'}]
// [2, {disallowedPaths: ['../userprofile', 'userprofile/subfolder'], domain: 'userprofile'}]
if (context.options.length > 0 ) {
context.options.forEach(({domain, disallowedPaths}) => {
disallowedPaths.forEach(disallowedPath => {
// @todo: make the isWithinDomain smarter
const isWithinDomain = filePath.includes(domain)
if (isWithinDomain && importPath === disallowedPath) {
if (!isWithinDomain && importPath === disallowedPath) {
context.report({

@@ -55,0 +55,0 @@ node,

{
"name": "eslint-plugin-disallow-cross-domain-imports",
"version": "1.0.6",
"version": "1.0.7",
"description": "disallow cross-importing of modules matching a defined list of paths unless with a 'domain'",

@@ -5,0 +5,0 @@ "keywords": [

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