eslint-plugin-pipedream
Advanced tools
Comparing version 0.2.2 to 0.2.3
92
index.js
@@ -23,2 +23,20 @@ function isModuleExports(node) { | ||
function getComponentFromNode(node) { | ||
if (isDefaultExport(node) && isObjectWithProperties(node.declaration)) { | ||
return node.declaration; | ||
} | ||
if (node.expression) { | ||
const { | ||
left, | ||
right, | ||
} = node.expression; | ||
if (isModuleExports(left) && isObjectWithProperties(right)) { | ||
return right; | ||
} | ||
} | ||
return null; | ||
} | ||
// Objects can contain key names surrounded by quotes, or not | ||
@@ -48,17 +66,4 @@ // propertyArray is the array of Property nodes in the component object | ||
function componentContainsPropertyCheck(context, node, propertyName, message) { | ||
let component; | ||
if (isDefaultExport(node)) { | ||
component = node.declaration; | ||
} | ||
const component = getComponentFromNode(node); | ||
if (node.expression) { | ||
const { | ||
left, | ||
right, | ||
} = node.expression; | ||
if (isModuleExports(left) && isObjectWithProperties(right)) { | ||
component = right; | ||
} | ||
} | ||
if (!component) return; | ||
@@ -85,15 +90,3 @@ if (!astIncludesProperty(propertyName, component.properties)) { | ||
function componentPropsContainsPropertyCheck(context, node, propertyName) { | ||
let component; | ||
if (isDefaultExport(node)) { | ||
component = node.declaration; | ||
} | ||
if (node.expression) { | ||
const { | ||
left, | ||
right, | ||
} = node.expression; | ||
if (isModuleExports(left) && isObjectWithProperties(right)) { | ||
component = right; | ||
} | ||
} | ||
const component = getComponentFromNode(node); | ||
@@ -125,17 +118,4 @@ if (!component) return; | ||
function optionalComponentPropsHaveDefaultProperty(context, node) { | ||
let component; | ||
if (isDefaultExport(node)) { | ||
component = node.declaration; | ||
} | ||
const component = getComponentFromNode(node); | ||
if (node.expression) { | ||
const { | ||
left, | ||
right, | ||
} = node.expression; | ||
if (isModuleExports(left) && isObjectWithProperties(right)) { | ||
component = right; | ||
} | ||
} | ||
if (!component) return; | ||
@@ -173,17 +153,4 @@ const { properties } = component; | ||
function checkComponentIsSourceAndReturnTargetProp(node, propertyName) { | ||
let component; | ||
if (isDefaultExport(node)) { | ||
component = node.declaration; | ||
} | ||
const component = getComponentFromNode(node); | ||
if (node.expression) { | ||
const { | ||
left, | ||
right, | ||
} = node.expression; | ||
if (isModuleExports(left) && isObjectWithProperties(right)) { | ||
component = right; | ||
} | ||
} | ||
if (!component) return; | ||
@@ -223,17 +190,4 @@ const { properties } = component; | ||
function componentVersionTsMacroCheck(context, node) { | ||
let component; | ||
if (isDefaultExport(node)) { | ||
component = node.declaration; | ||
} | ||
const component = getComponentFromNode(node); | ||
if (node.expression) { | ||
const { | ||
left, | ||
right, | ||
} = node.expression; | ||
if (isModuleExports(left) && isObjectWithProperties(right)) { | ||
component = right; | ||
} | ||
} | ||
if (!component) return; | ||
@@ -240,0 +194,0 @@ const { properties } = component; |
{ | ||
"name": "eslint-plugin-pipedream", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "ESLint plugin for Pipedream components: https://pipedream.com/docs/components/api/", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
9
129864
589