eslint-plugin-react-web-api 5.2.1-next.3 → 5.2.2-next.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.
Files changed (2) hide show
  1. package/dist/index.js +9 -10
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";
2
- import * as ast from "@eslint-react/ast";
3
- import { isOneOf } from "@eslint-react/ast";
2
+ import { Check, Compare, Traverse, isOneOf } from "@eslint-react/ast";
4
3
  import * as core from "@eslint-react/core";
5
4
  import { merge } from "@eslint-react/eslint";
6
5
  import { isAssignmentTargetEqual, isValueEqual, resolve, resolveEnclosingAssignmentTarget } from "@eslint-react/var";
@@ -28,7 +27,7 @@ var __exportAll = (all, no_symbols) => {
28
27
  //#endregion
29
28
  //#region package.json
30
29
  var name$1 = "eslint-plugin-react-web-api";
31
- var version = "5.2.1-next.3";
30
+ var version = "5.2.2-next.0";
32
31
 
33
32
  //#endregion
34
33
  //#region src/types/component-phase.ts
@@ -66,7 +65,7 @@ function getSignalValueExpression(context, node) {
66
65
  switch (node.type) {
67
66
  case AST_NODE_TYPES.Identifier: {
68
67
  const resolved = resolve(context, node);
69
- if (resolved != null && ast.isFunction(resolved)) return node;
68
+ if (resolved != null && Check.isFunction(resolved)) return node;
70
69
  return getSignalValueExpression(context, resolved);
71
70
  }
72
71
  case AST_NODE_TYPES.MemberExpression: return node;
@@ -87,14 +86,14 @@ function getOptions(context, node) {
87
86
  capture: Boolean(node.value)
88
87
  };
89
88
  case AST_NODE_TYPES.ObjectExpression: {
90
- const vCapture = match(ast.findProperty(node.properties, "capture")).with(P.nullish, () => false).with({ type: AST_NODE_TYPES.Property }, (prop) => {
89
+ const vCapture = match(Traverse.findProperty(node.properties, "capture")).with(P.nullish, () => false).with({ type: AST_NODE_TYPES.Property }, (prop) => {
91
90
  const value = prop.value;
92
91
  switch (value.type) {
93
92
  case AST_NODE_TYPES.Literal: return Boolean(value.value);
94
93
  default: return Boolean(getStaticValue(value, initialScope)?.value);
95
94
  }
96
95
  }).otherwise(() => false);
97
- const pSignal = ast.findProperty(node.properties, "signal");
96
+ const pSignal = Traverse.findProperty(node.properties, "signal");
98
97
  return {
99
98
  capture: vCapture,
100
99
  signal: pSignal?.type === AST_NODE_TYPES.Property ? getSignalValueExpression(context, pSignal.value) : null
@@ -128,7 +127,7 @@ function create$3(context) {
128
127
  const abortedSignals = [];
129
128
  function isSameObject(a, b) {
130
129
  switch (true) {
131
- case a.type === AST_NODE_TYPES.MemberExpression && b.type === AST_NODE_TYPES.MemberExpression: return ast.isNodeEqual(a.object, b.object);
130
+ case a.type === AST_NODE_TYPES.MemberExpression && b.type === AST_NODE_TYPES.MemberExpression: return Compare.areEqual(a.object, b.object);
132
131
  default: return false;
133
132
  }
134
133
  }
@@ -136,11 +135,11 @@ function create$3(context) {
136
135
  const { type: aType, callee: aCallee, capture: aCapture, listener: aListener, phase: aPhase } = aEntry;
137
136
  const { type: rType, callee: rCallee, capture: rCapture, listener: rListener, phase: rPhase } = rEntry;
138
137
  if (ComponentPhaseRelevance.get(aPhase) !== rPhase) return false;
139
- return isSameObject(aCallee, rCallee) && ast.isNodeEqual(aListener, rListener) && isValueEqual(context, aType, rType) && aCapture === rCapture;
138
+ return isSameObject(aCallee, rCallee) && Compare.areEqual(aListener, rListener) && isValueEqual(context, aType, rType) && aCapture === rCapture;
140
139
  }
141
140
  function checkInlineFunction(node, callKind, options) {
142
141
  const listener = node.arguments.at(1);
143
- if (!ast.isFunction(listener)) return;
142
+ if (!Check.isFunction(listener)) return;
144
143
  if (options.signal != null) return;
145
144
  context.report({
146
145
  data: { eventMethodKind: callKind },
@@ -593,7 +592,7 @@ function create$1(context) {
593
592
  const uentries = uEntries.filter((e) => isAssignmentTargetEqual(context, e.observer, id));
594
593
  const isDynamic = (node) => node?.type === AST_NODE_TYPES.CallExpression || isConditional(node);
595
594
  const isPhaseNode = (node) => node === phaseNode;
596
- if (oentries.some((e) => !isPhaseNode(ast.findParent(e.node, or(isDynamic, isPhaseNode))))) {
595
+ if (oentries.some((e) => !isPhaseNode(Traverse.findParent(e.node, or(isDynamic, isPhaseNode))))) {
597
596
  context.report({
598
597
  messageId: "expectedDisconnectInControlFlow",
599
598
  node
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-web-api",
3
- "version": "5.2.1-next.3",
3
+ "version": "5.2.2-next.0",
4
4
  "description": "ESLint React's ESLint plugin for interacting with Web APIs",
5
5
  "keywords": [
6
6
  "react",
@@ -43,19 +43,19 @@
43
43
  "@typescript-eslint/utils": "^8.58.1",
44
44
  "birecord": "^0.1.1",
45
45
  "ts-pattern": "^5.9.0",
46
- "@eslint-react/ast": "5.2.1-next.3",
47
- "@eslint-react/core": "5.2.1-next.3",
48
- "@eslint-react/shared": "5.2.1-next.3",
49
- "@eslint-react/eslint": "5.2.1-next.3",
50
- "@eslint-react/var": "5.2.1-next.3"
46
+ "@eslint-react/core": "5.2.2-next.0",
47
+ "@eslint-react/ast": "5.2.2-next.0",
48
+ "@eslint-react/eslint": "5.2.2-next.0",
49
+ "@eslint-react/shared": "5.2.2-next.0",
50
+ "@eslint-react/var": "5.2.2-next.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/react": "^19.2.14",
54
54
  "@types/react-dom": "^19.2.3",
55
55
  "eslint": "^10.2.0",
56
56
  "tsdown": "^0.21.7",
57
- "@local/eff": "3.0.0-beta.72",
58
- "@local/configs": "0.0.0"
57
+ "@local/configs": "0.0.0",
58
+ "@local/eff": "3.0.0-beta.72"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "eslint": "^10.2.0",