Skip to content

Commit 0f461c7

Browse files
committed
refactor: minor improvements
1 parent da4be2c commit 0f461c7

File tree

12 files changed

+21
-34
lines changed

12 files changed

+21
-34
lines changed

packages/core/docs/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
- [ERComponentHint](type-aliases/ERComponentHint.md)
2121
- [ERComponentKind](type-aliases/ERComponentKind.md)
2222
- [EREffectKind](type-aliases/EREffectKind.md)
23-
- [EREffectMethodKind](type-aliases/EREffectMethodKind.md)
2423
- [EREffectPhaseKind](type-aliases/EREffectPhaseKind.md)
2524
- [ERFunctionComponentFlag](type-aliases/ERFunctionComponentFlag.md)
2625
- [ERHookKind](type-aliases/ERHookKind.md)
27-
- [ERLifecycleMethodKind](type-aliases/ERLifecycleMethodKind.md)
2826
- [ERLifecyclePhaseKind](type-aliases/ERLifecyclePhaseKind.md)
2927
- [ERPhaseKind](type-aliases/ERPhaseKind.md)
3028
- [ERStateKind](type-aliases/ERStateKind.md)

packages/core/docs/type-aliases/EREffectKind.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
# Type Alias: EREffectKind
88

9-
> **EREffectKind**: `"effect"` \| `"insertionEffect"` \| `"layoutEffect"`
9+
> **EREffectKind**: `"useEffect"` \| `"useLayoutEffect"` \| `"useInsertionEffect"`

packages/core/docs/type-aliases/EREffectMethodKind.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/core/docs/type-aliases/ERLifecycleMethodKind.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/core/src/component/component-method-kind.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/core/src/component/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export * from "./component-flag";
55
export * from "./component-id";
66
export type * from "./component-kind";
77
export * from "./component-lifecycle";
8-
export type * from "./component-method-kind";
98
export * from "./component-name";
109
export * from "./component-phase";
1110
export * from "./component-render-prop";
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
export type EREffectKind = "effect" | "insertionEffect" | "layoutEffect";
1+
export type EREffectKind =
2+
| "useEffect"
3+
| "useLayoutEffect"
4+
| "useInsertionEffect";

packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-event-listener.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as AST from "@eslint-react/ast";
2-
import type { EREffectMethodKind, ERLifecycleMethodKind, ERPhaseKind } from "@eslint-react/core";
2+
import type { ERPhaseKind } from "@eslint-react/core";
33
import { ERPhaseRelevance, isInversePhase } from "@eslint-react/core";
44
import { _ } from "@eslint-react/eff";
55
import type { RuleFeature } from "@eslint-react/shared";
@@ -31,7 +31,9 @@ export type MessageID =
3131

3232
type FunctionKind = ERPhaseKind | "other";
3333
type EventMethodKind = "addEventListener" | "removeEventListener";
34-
type CallKind = EventMethodKind | EREffectMethodKind | ERLifecycleMethodKind | "abort" | "other";
34+
type EffectMethodKind = "useEffect" | "useInsertionEffect" | "useLayoutEffect";
35+
type LifecycleMethodKind = "componentDidMount" | "componentWillUnmount";
36+
type CallKind = EventMethodKind | EffectMethodKind | LifecycleMethodKind | "abort" | "other";
3537

3638
export type AEntry = EventListenerEntry & { kind: "addEventListener" };
3739

packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-interval.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type * as AST from "@eslint-react/ast";
2-
import type { EREffectMethodKind, ERLifecycleMethodKind, ERPhaseKind } from "@eslint-react/core";
2+
import type { ERPhaseKind } from "@eslint-react/core";
33
import { ERPhaseRelevance } from "@eslint-react/core";
44
import type { RuleFeature } from "@eslint-react/shared";
55
import * as VAR from "@eslint-react/var";
@@ -29,7 +29,9 @@ export type MessageID =
2929

3030
type FunctionKind = ERPhaseKind | "other";
3131
type EventMethodKind = "setInterval" | "clearInterval";
32-
type CallKind = EventMethodKind | EREffectMethodKind | ERLifecycleMethodKind | "other";
32+
type EffectMethodKind = "useEffect" | "useInsertionEffect" | "useLayoutEffect";
33+
type LifecycleMethodKind = "componentDidMount" | "componentWillUnmount";
34+
type CallKind = EventMethodKind | EffectMethodKind | LifecycleMethodKind | "other";
3335

3436
// #endregion
3537

packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-resize-observer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as AST from "@eslint-react/ast";
2-
import type { EREffectMethodKind, ERPhaseKind } from "@eslint-react/core";
2+
import type { ERPhaseKind } from "@eslint-react/core";
33
import { ERPhaseRelevance } from "@eslint-react/core";
44
import { _, or } from "@eslint-react/eff";
55
import type { RuleContext, RuleFeature } from "@eslint-react/shared";
@@ -29,7 +29,8 @@ export type MessageID =
2929
// #region Types
3030

3131
type FunctionKind = ERPhaseKind | "other";
32-
type CallKind = ObserverMethod | EREffectMethodKind | "other";
32+
type EffectMethodKind = "useEffect" | "useInsertionEffect" | "useLayoutEffect";
33+
type CallKind = ObserverMethod | EffectMethodKind | "other";
3334

3435
export type OEntry = ObserverEntry & { kind: "observe" };
3536
export type UEntry = ObserverEntry & { kind: "unobserve" };

0 commit comments

Comments
 (0)