eslint-plugin-testing-library
Advanced tools
Comparing version 5.7.2 to 5.7.3
{ | ||
"name": "eslint-plugin-testing-library", | ||
"version": "5.7.2", | ||
"version": "5.7.3", | ||
"description": "ESLint rules for Testing Library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -75,2 +75,17 @@ "use strict"; | ||
} | ||
function isSideEffectInVariableDeclaration(node) { | ||
return node.declarations.some((declaration) => { | ||
if ((0, node_utils_1.isCallExpression)(declaration.init)) { | ||
const test = (0, node_utils_1.getPropertyIdentifierNode)(declaration.init); | ||
if (!test) { | ||
return false; | ||
} | ||
return (helpers.isFireEventUtil(test) || | ||
helpers.isUserEventUtil(test) || | ||
helpers.isRenderUtil(test)); | ||
} | ||
return false; | ||
}); | ||
return false; | ||
} | ||
function getSideEffectNodes(body) { | ||
@@ -85,2 +100,6 @@ return body.filter((node) => { | ||
} | ||
if ((0, node_utils_1.isVariableDeclaration)(node) && | ||
isSideEffectInVariableDeclaration(node)) { | ||
return true; | ||
} | ||
const expressionIdentifier = (0, node_utils_1.getPropertyIdentifierNode)(node); | ||
@@ -87,0 +106,0 @@ if (!expressionIdentifier) { |
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
235504
4168