@pobammer-ts/eslint-cease-nonsense-rules 1.5.1 → 1.5.3

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "50d956502eeafe0ba32da6f4d873c0f6dc2ab2fd",
3
- "time": "2025-12-11T02:25:34.184Z",
4
- "version": "1.5.1"
2
+ "commit": "d46c18256e197357aa301828f8a0c64a89e57a3b",
3
+ "time": "2025-12-11T22:45:29.978Z",
4
+ "version": "1.5.3"
5
5
  }
package/dist/index.js CHANGED
@@ -17858,6 +17858,50 @@ function isNonPatternExpression(value) {
17858
17858
  function isNonPrivateExpression(value) {
17859
17859
  return value.type !== AST_NODE_TYPES3.PrivateIdentifier;
17860
17860
  }
17861
+ function objectHasFromAndTo(objectExpr) {
17862
+ let hasFrom = false;
17863
+ let hasTo = false;
17864
+ for (const property of objectExpr.properties) {
17865
+ if (property.type !== AST_NODE_TYPES3.Property)
17866
+ continue;
17867
+ if (property.computed)
17868
+ continue;
17869
+ if (property.key.type !== AST_NODE_TYPES3.Identifier)
17870
+ continue;
17871
+ if (property.key.name === "from")
17872
+ hasFrom = true;
17873
+ if (property.key.name === "to")
17874
+ hasTo = true;
17875
+ if (hasFrom && hasTo)
17876
+ return true;
17877
+ }
17878
+ return false;
17879
+ }
17880
+ function hasFromAndToProperties(context, expression) {
17881
+ const unwrapped = unwrapExpression(expression);
17882
+ if (unwrapped.type === AST_NODE_TYPES3.ObjectExpression)
17883
+ return objectHasFromAndTo(unwrapped);
17884
+ if (unwrapped.type === AST_NODE_TYPES3.Identifier) {
17885
+ const variable = findVariable(context, unwrapped);
17886
+ if (variable === undefined)
17887
+ return false;
17888
+ if (!isModuleLevelScope(variable.scope))
17889
+ return false;
17890
+ if (isImport(variable))
17891
+ return false;
17892
+ for (const def of variable.defs) {
17893
+ const initializer = getConstInitializer(def);
17894
+ if (initializer === undefined)
17895
+ continue;
17896
+ const normalizedInitializer = unwrapExpression(initializer);
17897
+ if (normalizedInitializer.type !== AST_NODE_TYPES3.ObjectExpression)
17898
+ continue;
17899
+ if (objectHasFromAndTo(normalizedInitializer))
17900
+ return true;
17901
+ }
17902
+ }
17903
+ return false;
17904
+ }
17861
17905
  function isStaticObjectLikeConfig(context, expression, seen, options3) {
17862
17906
  const unwrapped = unwrapExpression(expression);
17863
17907
  if (unwrapped.type === AST_NODE_TYPES3.ObjectExpression)
@@ -17993,6 +18037,8 @@ var noUselessUseSpring = {
17993
18037
  const seen = new Set;
17994
18038
  if (!isStaticObjectLikeConfig(context, configArgument, seen, normalized))
17995
18039
  return;
18040
+ if (hasFromAndToProperties(context, configArgument))
18041
+ return;
17996
18042
  const depsKind = classifyDependencies(context, node.arguments[1], seen, normalized);
17997
18043
  if (!depsAreNonUpdating(depsKind, normalized))
17998
18044
  return;
@@ -20249,14 +20295,15 @@ function collectCaptures(node, sourceCode) {
20249
20295
  function parseDependencies(node, sourceCode) {
20250
20296
  const dependencies4 = new Array;
20251
20297
  for (const element of node.elements) {
20252
- if (!element || element.type === TSESTree9.AST_NODE_TYPES.SpreadElement)
20298
+ if (!element)
20253
20299
  continue;
20254
- const name = nodeToDependencyString(element, sourceCode);
20255
- const depth = getMemberExpressionDepth(element);
20300
+ const actualNode = element.type === TSESTree9.AST_NODE_TYPES.SpreadElement ? element.argument : element;
20301
+ const name = nodeToDependencyString(actualNode, sourceCode);
20302
+ const depth = getMemberExpressionDepth(actualNode);
20256
20303
  dependencies4.push({
20257
20304
  depth,
20258
20305
  name,
20259
- node: element
20306
+ node: actualNode
20260
20307
  });
20261
20308
  }
20262
20309
  return dependencies4;
@@ -21061,4 +21108,4 @@ export {
21061
21108
  createBanInstancesOptions
21062
21109
  };
21063
21110
 
21064
- //# debugId=CF8A7F40832E416164756E2164756E21
21111
+ //# debugId=736A57F0AC33510764756E2164756E21