eslint-plugin-react-web-api 5.18.6 → 5.18.7

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 +20 -22
  2. package/package.json +14 -14
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ var __exportAll = (all, no_symbols) => {
28
28
  //#endregion
29
29
  //#region package.json
30
30
  var name$1 = "eslint-plugin-react-web-api";
31
- var version = "5.18.6";
31
+ var version = "5.18.7";
32
32
 
33
33
  //#endregion
34
34
  //#region src/types/component-phase.ts
@@ -165,13 +165,12 @@ function create$5(context) {
165
165
  const fKind = fEntries.findLast((x) => x.kind !== "other")?.kind;
166
166
  if (fKind == null) return;
167
167
  if (!ComponentPhaseRelevance.has(fKind)) return;
168
- const unwrappedCallee = Extract.unwrap(node.callee);
168
+ const callee = Extract.unwrap(node.callee);
169
169
  match(getCallKind$5(node)).with("addEventListener", (callKind) => {
170
- if (unwrappedCallee.type === AST_NODE_TYPES.MemberExpression && unwrappedCallee.object.type === AST_NODE_TYPES.Identifier && isInitializedFromReactNative(unwrappedCallee.object.name, context.sourceCode.getScope(node))) return;
170
+ if (callee.type === AST_NODE_TYPES.MemberExpression && Check.isIdentifier(callee.object) && isInitializedFromReactNative(callee.object.name, context.sourceCode.getScope(node))) return;
171
171
  const [type, listener, options] = node.arguments;
172
172
  if (type == null || listener == null) return;
173
173
  const opts = options == null ? defaultOptions : getOptions(context, options);
174
- const { callee } = node;
175
174
  checkInlineFunction(node, callKind, opts);
176
175
  aEntries.push({
177
176
  ...opts,
@@ -186,7 +185,6 @@ function create$5(context) {
186
185
  const [type, listener, options] = node.arguments;
187
186
  if (type == null || listener == null) return;
188
187
  const opts = options == null ? defaultOptions : getOptions(context, options);
189
- const { callee } = node;
190
188
  checkInlineFunction(node, callKind, opts);
191
189
  rEntries.push({
192
190
  ...opts,
@@ -224,7 +222,7 @@ function create$5(context) {
224
222
  //#region src/rules/no-leaked-fetch/lib.ts
225
223
  function findProperty(node, name) {
226
224
  for (const property of node) {
227
- if (property.type === AST_NODE_TYPES.Property && !property.computed && property.key.type === AST_NODE_TYPES.Identifier && property.key.name === name) return property;
225
+ if (property.type === AST_NODE_TYPES.Property && !property.computed && Check.isIdentifier(property.key, name)) return property;
228
226
  if (property.type === AST_NODE_TYPES.SpreadElement && property.argument.type === AST_NODE_TYPES.ObjectExpression) {
229
227
  const found = findProperty(property.argument.properties, name);
230
228
  if (found != null) return found;
@@ -869,11 +867,11 @@ const takeWhile = dual(2, (xs, pred) => {
869
867
  function isNewIntersectionObserver(node) {
870
868
  if (node?.type !== AST_NODE_TYPES.NewExpression) return false;
871
869
  const callee = Extract.unwrap(node.callee);
872
- return callee.type === AST_NODE_TYPES.Identifier && callee.name === "IntersectionObserver";
870
+ return Check.isIdentifier(callee, "IntersectionObserver");
873
871
  }
874
872
  function isFromObserver$1(context, node) {
875
873
  switch (true) {
876
- case node.type === AST_NODE_TYPES.Identifier: {
874
+ case Check.isIdentifier(node): {
877
875
  const initNode = resolve(context, node);
878
876
  return isNewIntersectionObserver(initNode == null ? null : Extract.unwrap(initNode));
879
877
  }
@@ -929,15 +927,15 @@ function create$3(context) {
929
927
  fEntries.pop();
930
928
  },
931
929
  ["CallExpression"](node) {
932
- const unwrappedCallee = Extract.unwrap(node.callee);
933
- if (unwrappedCallee.type !== AST_NODE_TYPES.MemberExpression) return;
930
+ const callee = Extract.unwrap(node.callee);
931
+ if (callee.type !== AST_NODE_TYPES.MemberExpression) return;
934
932
  const fKind = fEntries.findLast((x) => x.kind !== "other")?.kind;
935
933
  if (fKind == null || !ComponentPhaseRelevance.has(fKind)) return;
936
- const { object } = unwrappedCallee;
934
+ const { object } = callee;
937
935
  match(getCallKind$3(context, node)).with("disconnect", () => {
938
936
  dEntries.push({
939
937
  kind: "IntersectionObserver",
940
- callee: node.callee,
938
+ callee,
941
939
  method: "disconnect",
942
940
  node,
943
941
  observer: object,
@@ -948,7 +946,7 @@ function create$3(context) {
948
946
  if (element == null) return;
949
947
  oEntries.push({
950
948
  kind: "IntersectionObserver",
951
- callee: node.callee,
949
+ callee,
952
950
  element,
953
951
  method: "observe",
954
952
  node,
@@ -960,7 +958,7 @@ function create$3(context) {
960
958
  if (element == null) return;
961
959
  uEntries.push({
962
960
  kind: "IntersectionObserver",
963
- callee: node.callee,
961
+ callee,
964
962
  element,
965
963
  method: "unobserve",
966
964
  node,
@@ -1120,11 +1118,11 @@ function create$2(context) {
1120
1118
  function isNewResizeObserver(node) {
1121
1119
  if (node?.type !== AST_NODE_TYPES.NewExpression) return false;
1122
1120
  const callee = Extract.unwrap(node.callee);
1123
- return callee.type === AST_NODE_TYPES.Identifier && callee.name === "ResizeObserver";
1121
+ return Check.isIdentifier(callee, "ResizeObserver");
1124
1122
  }
1125
1123
  function isFromObserver(context, node) {
1126
1124
  switch (true) {
1127
- case node.type === AST_NODE_TYPES.Identifier: {
1125
+ case Check.isIdentifier(node): {
1128
1126
  const initNode = resolve(context, node);
1129
1127
  return isNewResizeObserver(initNode == null ? null : Extract.unwrap(initNode));
1130
1128
  }
@@ -1180,15 +1178,15 @@ function create$1(context) {
1180
1178
  fEntries.pop();
1181
1179
  },
1182
1180
  ["CallExpression"](node) {
1183
- const unwrappedCallee = Extract.unwrap(node.callee);
1184
- if (unwrappedCallee.type !== AST_NODE_TYPES.MemberExpression) return;
1181
+ const callee = Extract.unwrap(node.callee);
1182
+ if (callee.type !== AST_NODE_TYPES.MemberExpression) return;
1185
1183
  const fKind = fEntries.findLast((x) => x.kind !== "other")?.kind;
1186
1184
  if (fKind == null || !ComponentPhaseRelevance.has(fKind)) return;
1187
- const { object } = unwrappedCallee;
1185
+ const { object } = callee;
1188
1186
  match(getCallKind$1(context, node)).with("disconnect", () => {
1189
1187
  dEntries.push({
1190
1188
  kind: "ResizeObserver",
1191
- callee: node.callee,
1189
+ callee,
1192
1190
  method: "disconnect",
1193
1191
  node,
1194
1192
  observer: object,
@@ -1199,7 +1197,7 @@ function create$1(context) {
1199
1197
  if (element == null) return;
1200
1198
  oEntries.push({
1201
1199
  kind: "ResizeObserver",
1202
- callee: node.callee,
1200
+ callee,
1203
1201
  element,
1204
1202
  method: "observe",
1205
1203
  node,
@@ -1211,7 +1209,7 @@ function create$1(context) {
1211
1209
  if (element == null) return;
1212
1210
  uEntries.push({
1213
1211
  kind: "ResizeObserver",
1214
- callee: node.callee,
1212
+ callee,
1215
1213
  element,
1216
1214
  method: "unobserve",
1217
1215
  node,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-web-api",
3
- "version": "5.18.6",
3
+ "version": "5.18.7",
4
4
  "description": "ESLint React's ESLint plugin for interacting with Web APIs",
5
5
  "keywords": [
6
6
  "react",
@@ -37,25 +37,25 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@typescript-eslint/types": "^8.67.0",
41
- "@typescript-eslint/utils": "^8.67.0",
40
+ "@eslint-react/ast": "5.18.7",
41
+ "@eslint-react/core": "5.18.7",
42
+ "@eslint-react/eslint": "5.18.7",
43
+ "@eslint-react/shared": "5.18.7",
44
+ "@eslint-react/var": "5.18.7",
45
+ "@typescript-eslint/types": "^8.69.0",
46
+ "@typescript-eslint/utils": "^8.69.0",
42
47
  "birecord": "^0.1.2",
43
- "ts-pattern": "^5.9.0",
44
- "@eslint-react/ast": "5.18.6",
45
- "@eslint-react/core": "5.18.6",
46
- "@eslint-react/eslint": "5.18.6",
47
- "@eslint-react/shared": "5.18.6",
48
- "@eslint-react/var": "5.18.6"
48
+ "ts-pattern": "^5.9.0"
49
49
  },
50
50
  "devDependencies": {
51
+ "@local/configs": "0.0.0",
52
+ "@local/eff": "0.0.0",
51
53
  "@types/react": "^19.2.18",
52
- "@types/react-dom": "^19.2.4",
54
+ "@types/react-dom": "^19.2.5",
53
55
  "dedent": "^1.7.2",
54
- "eslint": "^10.8.1",
56
+ "eslint": "^10.9.1",
55
57
  "tsdown": "^0.22.14",
56
- "typescript": "6.0.3",
57
- "@local/eff": "0.0.0",
58
- "@local/configs": "0.0.0"
58
+ "typescript": "6.0.3"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "eslint": "*",