eslint-plugin-react-web-api 2.0.7-beta.1 → 2.0.7-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +5 -12
  2. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -37,7 +37,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
37
37
  //#endregion
38
38
  //#region package.json
39
39
  var name = "eslint-plugin-react-web-api";
40
- var version = "2.0.7-beta.1";
40
+ var version = "2.0.7-beta.3";
41
41
 
42
42
  //#endregion
43
43
  //#region src/utils/create-rule.ts
@@ -90,8 +90,7 @@ function getOptions(node, initialScope) {
90
90
  function getOpts(node$1) {
91
91
  switch (node$1.type) {
92
92
  case AST_NODE_TYPES.Identifier: {
93
- const variable = findVariable(node$1, initialScope);
94
- const variableNode = getVariableDefinitionNode(variable, 0);
93
+ const variableNode = getVariableDefinitionNode(findVariable(node$1, initialScope), 0);
95
94
  if (variableNode?.type === AST_NODE_TYPES.ObjectExpression) return getOpts(variableNode);
96
95
  return defaultOptions;
97
96
  }
@@ -100,13 +99,11 @@ function getOptions(node, initialScope) {
100
99
  capture: Boolean(node$1.value)
101
100
  };
102
101
  case AST_NODE_TYPES.ObjectExpression: {
103
- const pCapture = findProp(node$1.properties, "capture");
104
- const vCapture = !!getPropValue(pCapture);
102
+ const vCapture = !!getPropValue(findProp(node$1.properties, "capture"));
105
103
  const pSignal = findProp(node$1.properties, "signal");
106
- const vSignal = pSignal?.type === AST_NODE_TYPES.Property ? getSignalValueExpression(pSignal.value, initialScope) : unit;
107
104
  return {
108
105
  capture: vCapture,
109
- signal: vSignal
106
+ signal: pSignal?.type === AST_NODE_TYPES.Property ? getSignalValueExpression(pSignal.value, initialScope) : unit
110
107
  };
111
108
  }
112
109
  default: return defaultOptions;
@@ -360,11 +357,7 @@ function isNewResizeObserver(node) {
360
357
  }
361
358
  function isFromObserver(context, node) {
362
359
  switch (true) {
363
- case node.type === AST_NODE_TYPES.Identifier: {
364
- const initialScope = context.sourceCode.getScope(node);
365
- const object = getVariableDefinitionNode(findVariable(node, initialScope), 0);
366
- return isNewResizeObserver(object);
367
- }
360
+ case node.type === AST_NODE_TYPES.Identifier: return isNewResizeObserver(getVariableDefinitionNode(findVariable(node, context.sourceCode.getScope(node)), 0));
368
361
  case node.type === AST_NODE_TYPES.MemberExpression: return isFromObserver(context, node.object);
369
362
  default: return false;
370
363
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-web-api",
3
- "version": "2.0.7-beta.1",
3
+ "version": "2.0.7-beta.3",
4
4
  "description": "ESLint React's ESLint plugin for interacting with Web APIs",
5
5
  "keywords": [
6
6
  "react",
@@ -35,21 +35,21 @@
35
35
  "./package.json"
36
36
  ],
37
37
  "dependencies": {
38
- "@typescript-eslint/scope-manager": "^8.45.0",
39
- "@typescript-eslint/types": "^8.45.0",
40
- "@typescript-eslint/utils": "^8.45.0",
38
+ "@typescript-eslint/scope-manager": "^8.46.0",
39
+ "@typescript-eslint/types": "^8.46.0",
40
+ "@typescript-eslint/utils": "^8.46.0",
41
41
  "string-ts": "^2.2.1",
42
42
  "ts-pattern": "^5.8.0",
43
- "@eslint-react/ast": "2.0.7-beta.1",
44
- "@eslint-react/core": "2.0.7-beta.1",
45
- "@eslint-react/eff": "2.0.7-beta.1",
46
- "@eslint-react/shared": "2.0.7-beta.1",
47
- "@eslint-react/var": "2.0.7-beta.1",
48
- "@eslint-react/kit": "2.0.7-beta.1"
43
+ "@eslint-react/ast": "2.0.7-beta.3",
44
+ "@eslint-react/kit": "2.0.7-beta.3",
45
+ "@eslint-react/shared": "2.0.7-beta.3",
46
+ "@eslint-react/eff": "2.0.7-beta.3",
47
+ "@eslint-react/core": "2.0.7-beta.3",
48
+ "@eslint-react/var": "2.0.7-beta.3"
49
49
  },
50
50
  "devDependencies": {
51
- "@types/react": "^19.2.0",
52
- "@types/react-dom": "^19.2.0",
51
+ "@types/react": "^19.2.2",
52
+ "@types/react-dom": "^19.2.1",
53
53
  "tsdown": "^0.15.6",
54
54
  "@local/configs": "0.0.0"
55
55
  },