eslint-plugin-disallow-cross-domain-imports
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -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": [ |
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
4717