eslint-plugin-react-web-api 2.7.5-next.1 → 2.7.5-next.11

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 +15 -3
  2. package/package.json +11 -10
package/dist/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { DEFAULT_ESLINT_REACT_SETTINGS, WEBSITE_URL, getConfigAdapters } from "@eslint-react/shared";
2
2
  import * as AST from "@eslint-react/ast";
3
- import { ComponentPhaseRelevance, getPhaseKindOfFunction, isInitializedFromReactNative, isInversePhase } from "@eslint-react/core";
4
- import { or, unit } from "@eslint-react/eff";
3
+ import { isComponentDidMountCallback, isComponentWillUnmountCallback, isInitializedFromReactNative, isUseEffectCleanupCallback, isUseEffectSetupCallback } from "@eslint-react/core";
4
+ import { dual, or, unit } from "@eslint-react/eff";
5
5
  import { findEnclosingAssignmentTarget, findProperty, findVariable, getVariableDefinitionNode, isAssignmentTargetEqual, isNodeValueEqual } 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";
9
+ import birecord from "birecord";
9
10
 
10
11
  //#region rolldown:runtime
11
12
  var __defProp = Object.defineProperty;
@@ -42,7 +43,18 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
42
43
  //#endregion
43
44
  //#region package.json
44
45
  var name = "eslint-plugin-react-web-api";
45
- var version = "2.7.5-next.1";
46
+ var version = "2.7.5-next.11";
47
+
48
+ //#endregion
49
+ //#region src/types/component-phase.ts
50
+ const ComponentPhaseRelevance = birecord({
51
+ mount: "unmount",
52
+ setup: "cleanup"
53
+ });
54
+ const isInversePhase = dual(2, (a, b) => ComponentPhaseRelevance.get(a) === b);
55
+ function getPhaseKindOfFunction(node) {
56
+ return match(node).when(isUseEffectSetupCallback, () => "setup").when(isUseEffectCleanupCallback, () => "cleanup").when(isComponentDidMountCallback, () => "mount").when(isComponentWillUnmountCallback, () => "unmount").otherwise(() => null);
57
+ }
46
58
 
47
59
  //#endregion
48
60
  //#region src/utils/create-rule.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-web-api",
3
- "version": "2.7.5-next.1",
3
+ "version": "2.7.5-next.11",
4
4
  "description": "ESLint React's ESLint plugin for interacting with Web APIs",
5
5
  "keywords": [
6
6
  "react",
@@ -38,19 +38,20 @@
38
38
  "./package.json"
39
39
  ],
40
40
  "dependencies": {
41
- "@typescript-eslint/scope-manager": "^8.53.1",
42
- "@typescript-eslint/types": "^8.53.1",
43
- "@typescript-eslint/utils": "^8.53.1",
41
+ "@typescript-eslint/scope-manager": "^8.54.0",
42
+ "@typescript-eslint/types": "^8.54.0",
43
+ "@typescript-eslint/utils": "^8.54.0",
44
+ "birecord": "^0.1.1",
44
45
  "string-ts": "^2.3.1",
45
46
  "ts-pattern": "^5.9.0",
46
- "@eslint-react/core": "2.7.5-next.1",
47
- "@eslint-react/ast": "2.7.5-next.1",
48
- "@eslint-react/eff": "2.7.5-next.1",
49
- "@eslint-react/shared": "2.7.5-next.1",
50
- "@eslint-react/var": "2.7.5-next.1"
47
+ "@eslint-react/ast": "2.7.5-next.11",
48
+ "@eslint-react/shared": "2.7.5-next.11",
49
+ "@eslint-react/eff": "2.7.5-next.11",
50
+ "@eslint-react/var": "2.7.5-next.11",
51
+ "@eslint-react/core": "2.7.5-next.11"
51
52
  },
52
53
  "devDependencies": {
53
- "@types/react": "^19.2.9",
54
+ "@types/react": "^19.2.10",
54
55
  "@types/react-dom": "^19.2.3",
55
56
  "tsdown": "^0.20.1",
56
57
  "@local/configs": "0.0.0"