Skip to content

Commit a432afe

Browse files
committed
refactor: minor improvements
1 parent c65ef96 commit a432afe

File tree

21 files changed

+60
-57
lines changed

21 files changed

+60
-57
lines changed

packages/core/docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
- [ERClassComponentFlag](variables/ERClassComponentFlag.md)
3535
- [ERComponentHint](variables/ERComponentHint.md)
3636
- [ERFunctionComponentFlag](variables/ERFunctionComponentFlag.md)
37-
- [PHASE\_RELEVANCE](variables/PHASE_RELEVANCE.md)
37+
- [ERPhaseRelevance](variables/ERPhaseRelevance.md)
3838
- [RE\_COMPONENT\_NAME](variables/RE_COMPONENT_NAME.md)
3939
- [RE\_HOOK\_NAME](variables/RE_HOOK_NAME.md)
4040

packages/core/docs/variables/PHASE_RELEVANCE.md renamed to packages/core/docs/variables/ERPhaseRelevance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
***
44

5-
[@eslint-react/core](../README.md) / PHASE\_RELEVANCE
5+
[@eslint-react/core](../README.md) / ERPhaseRelevance
66

7-
# Variable: PHASE\_RELEVANCE
7+
# Variable: ERPhaseRelevance
88

9-
> `const` **PHASE\_RELEVANCE**: `BiRecord`\<`object`\>
9+
> `const` **ERPhaseRelevance**: `BiRecord`\<`object`\>
1010
1111
## Type declaration
1212

packages/core/src/component/component-id.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { TSESTree } from "@typescript-eslint/types";
55
import { AST_NODE_TYPES } from "@typescript-eslint/types";
66

77
import { isReactHookCallWithNameLoose } from "../hook";
8-
import { isForwardRefCall, isMemoCall } from "../react-api";
8+
import { isForwardRefCall, isMemoCall } from "../utils";
99

1010
function isComponentWrapperCall(node: TSESTree.Node, context: RuleContext) {
1111
if (node.type !== AST_NODE_TYPES.CallExpression) return false;

packages/core/src/element/hierarchy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { RuleContext } from "@eslint-react/types";
44
import type { TSESTree } from "@typescript-eslint/types";
55
import { AST_NODE_TYPES } from "@typescript-eslint/types";
66

7-
import { isCreateElementCall } from "../react-api";
7+
import { isCreateElementCall } from "../utils";
88

99
/**
1010
* Determines whether inside createElement's props.

packages/core/src/element/misc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { RuleContext } from "@eslint-react/types";
33
import type { TSESTree } from "@typescript-eslint/types";
44
import { AST_NODE_TYPES } from "@typescript-eslint/types";
55

6-
import { isInitializedFromReact } from "../is-initialized-from-react";
6+
import { isInitializedFromReact } from "../utils";
77

88
/**
99
* Check if a node is `<Fragment></Fragment>` or `<Pragma.Fragment></Pragma.Fragment>`

packages/core/src/hook/is.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { RuleContext } from "@eslint-react/types";
55
import type { TSESTree } from "@typescript-eslint/types";
66
import { AST_NODE_TYPES } from "@typescript-eslint/types";
77

8-
import { isInitializedFromReact } from "../is-initialized-from-react";
8+
import { isInitializedFromReact } from "../utils";
99
import { isReactHookName } from "./hook-name";
1010

1111
export function isReactHook(node: AST.TSESTreeFunction) {

packages/core/src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ export * from "./component";
22
export * from "./effect";
33
export * from "./element";
44
export * from "./hook";
5-
export * from "./is-from-react";
6-
export * from "./is-initialized-from-react";
7-
export * from "./is-react-api";
85
export * from "./phase";
9-
export * from "./react-api";
106
export * from "./render-prop";
117
export type * from "./semantic-entry";
128
export type * from "./semantic-node";
139
export * from "./state";
10+
export * from "./utils";

packages/core/src/is-react-api.ts

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

packages/core/src/phase.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import birecord from "birecord";
2+
3+
export const ERPhaseRelevance = birecord({
4+
mount: "unmount",
5+
setup: "cleanup",
6+
});

0 commit comments

Comments
 (0)