@slip-stream-kit/eslint-plugin 0.34.0 → 0.36.0

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/dist/index.js CHANGED
@@ -61,12 +61,17 @@ var collectOwnReturnArguments = (node) => {
61
61
  return;
62
62
  }
63
63
  if (current.type === "BlockStatement") {
64
- current.body.forEach(visit);
64
+ for (const statement of current.body) {
65
+ visit(statement);
66
+ }
65
67
  return;
66
68
  }
67
69
  if (current.type === "SwitchStatement") {
68
- for (const switchCase of current.cases) {
69
- switchCase.consequent.forEach(visit);
70
+ const statements = current.cases.flatMap((switchCase) => {
71
+ return switchCase.consequent;
72
+ });
73
+ for (const statement of statements) {
74
+ visit(statement);
70
75
  }
71
76
  return;
72
77
  }
@@ -80,7 +85,9 @@ var collectOwnReturnArguments = (node) => {
80
85
  visit(current.body);
81
86
  }
82
87
  };
83
- node.body.body.forEach(visit);
88
+ for (const statement of node.body.body) {
89
+ visit(statement);
90
+ }
84
91
  return args;
85
92
  };
86
93
  var returnsJsx = (node) => {
@@ -348,13 +355,13 @@ var collectTopLevel = (body) => {
348
355
  const components = [];
349
356
  const declIndexByName = /* @__PURE__ */ new Map();
350
357
  const importedNames = /* @__PURE__ */ new Set();
351
- body.forEach((statement, index) => {
358
+ for (const [index, statement] of body.entries()) {
352
359
  if (statement.type === "ImportDeclaration") {
353
360
  importIndices.push(index);
354
361
  for (const specifier of statement.specifiers) {
355
362
  importedNames.add(specifier.local.name);
356
363
  }
357
- return;
364
+ continue;
358
365
  }
359
366
  const declaration = unwrapExport(statement);
360
367
  const declName = getTypeDeclName(declaration);
@@ -366,7 +373,7 @@ var collectTopLevel = (body) => {
366
373
  const propsName = getComponentPropsTypeName(declaration) ?? (name === null ? null : `${name}${PROPS_SUFFIX}`);
367
374
  components.push({ index, name, propsName });
368
375
  }
369
- });
376
+ }
370
377
  return { importIndices, components, declIndexByName, importedNames };
371
378
  };
372
379
  var hasStrayBefore = (body, boundary, directiveCount, skipIndex) => {
@@ -2348,7 +2355,9 @@ var maxJsxReturnSize = {
2348
2355
  };
2349
2356
  return {
2350
2357
  Program(program) {
2351
- collectComponents2(program.body).forEach(checkComponent);
2358
+ for (const component of collectComponents2(program.body)) {
2359
+ checkComponent(component);
2360
+ }
2352
2361
  }
2353
2362
  };
2354
2363
  }
@@ -3506,7 +3515,7 @@ var PLUGIN_NAME = "@wl";
3506
3515
  var plugin = {
3507
3516
  meta: {
3508
3517
  name: "@wl/eslint-plugin",
3509
- version: "0.34.0"
3518
+ version: "0.36.0"
3510
3519
  },
3511
3520
  rules,
3512
3521
  configs: {}