eslint-plugin-react-web-api 2.0.0-next.43 → 2.0.0-next.44

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 +8 -8
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { getDocsUrl, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
2
2
  import * as AST from '@eslint-react/ast';
3
3
  import * as ER4 from '@eslint-react/core';
4
- import { _, or } from '@eslint-react/eff';
4
+ import { unit, or } from '@eslint-react/eff';
5
5
  import * as VAR from '@eslint-react/var';
6
6
  import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
7
7
  import { match, isMatching, P } from 'ts-pattern';
@@ -33,7 +33,7 @@ var settings = {
33
33
 
34
34
  // package.json
35
35
  var name2 = "eslint-plugin-react-web-api";
36
- var version = "2.0.0-next.43";
36
+ var version = "2.0.0-next.44";
37
37
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("web-api"));
38
38
  function getPhaseKindOfFunction(node) {
39
39
  return match(node).when(isFunctionOfUseEffectSetup, () => "setup").when(isFunctionOfUseEffectCleanup, () => "cleanup").when(isFunctionOfComponentDidMount, () => "mount").when(isFunctionOfComponentWillUnmount, () => "unmount").otherwise(() => null);
@@ -63,7 +63,7 @@ var RULE_FEATURES = [];
63
63
  var defaultOptions = {
64
64
  capture: false,
65
65
  // once: false,
66
- signal: _
66
+ signal: unit
67
67
  };
68
68
  function getCallKind(node) {
69
69
  switch (true) {
@@ -79,7 +79,7 @@ function getFunctionKind(node) {
79
79
  return getPhaseKindOfFunction(node) ?? "other";
80
80
  }
81
81
  function getSignalValueExpression(node, initialScope) {
82
- if (node == null) return _;
82
+ if (node == null) return unit;
83
83
  switch (node.type) {
84
84
  case AST_NODE_TYPES.Identifier: {
85
85
  return getSignalValueExpression(VAR.getVariableInitNode(VAR.findVariable(node, initialScope), 0), initialScope);
@@ -87,7 +87,7 @@ function getSignalValueExpression(node, initialScope) {
87
87
  case AST_NODE_TYPES.MemberExpression:
88
88
  return node;
89
89
  default:
90
- return _;
90
+ return unit;
91
91
  }
92
92
  }
93
93
  function getOptions(node, initialScope) {
@@ -95,7 +95,7 @@ function getOptions(node, initialScope) {
95
95
  return VAR.findPropertyInProperties(propName, properties, initialScope);
96
96
  }
97
97
  function getPropValue(prop, filter = (a) => true) {
98
- if (prop?.type !== AST_NODE_TYPES.Property) return _;
98
+ if (prop?.type !== AST_NODE_TYPES.Property) return unit;
99
99
  const { value } = prop;
100
100
  let v = value;
101
101
  switch (value.type) {
@@ -108,7 +108,7 @@ function getOptions(node, initialScope) {
108
108
  break;
109
109
  }
110
110
  }
111
- return filter(v) ? v : _;
111
+ return filter(v) ? v : unit;
112
112
  }
113
113
  function getOpts(node2) {
114
114
  switch (node2.type) {
@@ -127,7 +127,7 @@ function getOptions(node, initialScope) {
127
127
  const pCapture = findProp(node2.properties, "capture");
128
128
  const vCapture = !!getPropValue(pCapture);
129
129
  const pSignal = findProp(node2.properties, "signal");
130
- const vSignal = pSignal?.type === AST_NODE_TYPES.Property ? getSignalValueExpression(pSignal.value, initialScope) : _;
130
+ const vSignal = pSignal?.type === AST_NODE_TYPES.Property ? getSignalValueExpression(pSignal.value, initialScope) : unit;
131
131
  return { capture: vCapture, signal: vSignal };
132
132
  }
133
133
  default: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-web-api",
3
- "version": "2.0.0-next.43",
3
+ "version": "2.0.0-next.44",
4
4
  "description": "ESLint React's ESLint plugin for interacting with Web APIs",
5
5
  "keywords": [
6
6
  "react",
@@ -40,12 +40,12 @@
40
40
  "@typescript-eslint/utils": "^8.34.0",
41
41
  "string-ts": "^2.2.1",
42
42
  "ts-pattern": "^5.7.1",
43
- "@eslint-react/ast": "2.0.0-next.43",
44
- "@eslint-react/eff": "2.0.0-next.43",
45
- "@eslint-react/kit": "2.0.0-next.43",
46
- "@eslint-react/core": "2.0.0-next.43",
47
- "@eslint-react/shared": "2.0.0-next.43",
48
- "@eslint-react/var": "2.0.0-next.43"
43
+ "@eslint-react/ast": "2.0.0-next.44",
44
+ "@eslint-react/core": "2.0.0-next.44",
45
+ "@eslint-react/eff": "2.0.0-next.44",
46
+ "@eslint-react/kit": "2.0.0-next.44",
47
+ "@eslint-react/var": "2.0.0-next.44",
48
+ "@eslint-react/shared": "2.0.0-next.44"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/react": "^19.1.8",
@@ -54,7 +54,7 @@
54
54
  "@local/configs": "0.0.0"
55
55
  },
56
56
  "peerDependencies": {
57
- "eslint": "^9.28.0",
57
+ "eslint": "^9.29.0",
58
58
  "typescript": "^4.9.5 || ^5.4.5"
59
59
  },
60
60
  "peerDependenciesMeta": {