eslint-plugin-effector 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-effector",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Enforcing best practices for Effector",
5
5
  "keywords": [
6
6
  "eslint",
@@ -21,11 +21,13 @@ module.exports = {
21
21
  },
22
22
  create(context) {
23
23
  function onEffectHandler(node) {
24
- if (!node.body?.body) {
24
+ const functionBody = node.body?.body;
25
+
26
+ if (!Array.isArray(functionBody)) {
25
27
  return;
26
28
  }
27
29
 
28
- const calledNodes = node.body.body
30
+ const calledNodes = functionBody
29
31
  .filter((bodyNode) => bodyNode.expression?.type === "AwaitExpression")
30
32
  .map((awaitNode) => ({
31
33
  node: awaitNode.expression.argument.callee,