eslint-plugin-react-web-api 3.0.0-next.12 → 3.0.0-next.13

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -6
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { DEFAULT_ESLINT_REACT_SETTINGS, WEBSITE_URL, defineRuleListener, getConf
2
2
  import * as ast from "@eslint-react/ast";
3
3
  import * as core from "@eslint-react/core";
4
4
  import { dual, or, unit } from "@eslint-react/eff";
5
- import { findEnclosingAssignmentTarget, findProperty, findVariable, getVariableDefinitionNode, isAssignmentTargetEqual, isNodeEqual } from "@eslint-react/var";
5
+ import { findEnclosingAssignmentTarget, findProperty, findVariable, getVariableInitializer, isAssignmentTargetEqual, isValueEqual } from "@eslint-react/var";
6
6
  import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
7
7
  import { getStaticValue } from "@typescript-eslint/utils/ast-utils";
8
8
  import { P, isMatching, match } from "ts-pattern";
@@ -43,7 +43,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
43
43
  //#endregion
44
44
  //#region package.json
45
45
  var name = "eslint-plugin-react-web-api";
46
- var version = "3.0.0-next.12";
46
+ var version = "3.0.0-next.13";
47
47
 
48
48
  //#endregion
49
49
  //#region src/types/component-phase.ts
@@ -83,7 +83,7 @@ function getFunctionKind$1(node) {
83
83
  function getSignalValueExpression(node, initialScope) {
84
84
  if (node == null) return unit;
85
85
  switch (node.type) {
86
- case AST_NODE_TYPES.Identifier: return getSignalValueExpression(getVariableDefinitionNode(findVariable(node, initialScope), 0), initialScope);
86
+ case AST_NODE_TYPES.Identifier: return getSignalValueExpression(getVariableInitializer(findVariable(node, initialScope), 0), initialScope);
87
87
  case AST_NODE_TYPES.MemberExpression: return node;
88
88
  default: return unit;
89
89
  }
@@ -95,7 +95,7 @@ function getOptions(node, initialScope) {
95
95
  function getOpts(node) {
96
96
  switch (node.type) {
97
97
  case AST_NODE_TYPES.Identifier: {
98
- const variableNode = getVariableDefinitionNode(findVariable(node, initialScope), 0);
98
+ const variableNode = getVariableInitializer(findVariable(node, initialScope), 0);
99
99
  if (variableNode?.type === AST_NODE_TYPES.ObjectExpression) return getOpts(variableNode);
100
100
  return defaultOptions;
101
101
  }
@@ -154,7 +154,7 @@ function create$3(context) {
154
154
  const { type: aType, callee: aCallee, capture: aCapture, listener: aListener, phase: aPhase } = aEntry;
155
155
  const { type: rType, callee: rCallee, capture: rCapture, listener: rListener, phase: rPhase } = rEntry;
156
156
  if (!isInversePhase(aPhase, rPhase)) return false;
157
- return isSameObject(aCallee, rCallee) && ast.isNodeEqual(aListener, rListener) && isNodeEqual(aType, rType, [context.sourceCode.getScope(aType), context.sourceCode.getScope(rType)]) && aCapture === rCapture;
157
+ return isSameObject(aCallee, rCallee) && ast.isNodeEqual(aListener, rListener) && isValueEqual(aType, rType, [context.sourceCode.getScope(aType), context.sourceCode.getScope(rType)]) && aCapture === rCapture;
158
158
  }
159
159
  function checkInlineFunction(node, callKind, options) {
160
160
  const listener = node.arguments.at(1);
@@ -360,7 +360,7 @@ function isNewResizeObserver(node) {
360
360
  }
361
361
  function isFromObserver(context, node) {
362
362
  switch (true) {
363
- case node.type === AST_NODE_TYPES.Identifier: return isNewResizeObserver(getVariableDefinitionNode(findVariable(node, context.sourceCode.getScope(node)), 0));
363
+ case node.type === AST_NODE_TYPES.Identifier: return isNewResizeObserver(getVariableInitializer(findVariable(node, context.sourceCode.getScope(node)), 0));
364
364
  case node.type === AST_NODE_TYPES.MemberExpression: return isFromObserver(context, node.object);
365
365
  default: return false;
366
366
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-web-api",
3
- "version": "3.0.0-next.12",
3
+ "version": "3.0.0-next.13",
4
4
  "description": "ESLint React's ESLint plugin for interacting with Web APIs",
5
5
  "keywords": [
6
6
  "react",
@@ -43,11 +43,11 @@
43
43
  "@typescript-eslint/utils": "canary",
44
44
  "birecord": "^0.1.1",
45
45
  "ts-pattern": "^5.9.0",
46
- "@eslint-react/ast": "3.0.0-next.12",
47
- "@eslint-react/core": "3.0.0-next.12",
48
- "@eslint-react/eff": "3.0.0-next.12",
49
- "@eslint-react/shared": "3.0.0-next.12",
50
- "@eslint-react/var": "3.0.0-next.12"
46
+ "@eslint-react/ast": "3.0.0-next.13",
47
+ "@eslint-react/core": "3.0.0-next.13",
48
+ "@eslint-react/eff": "3.0.0-next.13",
49
+ "@eslint-react/shared": "3.0.0-next.13",
50
+ "@eslint-react/var": "3.0.0-next.13"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/react": "^19.2.14",