Skip to content

Commit a37cd96

Browse files
committed
refactor: move getId function to shared package and update imports
1 parent c596ade commit a37cd96

File tree

10 files changed

+18
-19
lines changed

10 files changed

+18
-19
lines changed

packages/core/docs/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343

4444
- [getComponentNameFromIdentifier](functions/getComponentNameFromIdentifier.md)
4545
- [getFunctionComponentIdentifier](functions/getFunctionComponentIdentifier.md)
46-
- [getId](functions/getId.md)
4746
- [hasNoneOrValidComponentName](functions/hasNoneOrValidComponentName.md)
4847
- [isCallFromReact](functions/isCallFromReact.md)
4948
- [isCallFromReactMember](functions/isCallFromReactMember.md)

packages/core/docs/functions/getId.md

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

packages/core/src/component/component-collector-legacy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as AST from "@eslint-react/ast";
22
import { _ } from "@eslint-react/eff";
3+
import { getId } from "@eslint-react/shared";
34
import type { ESLintUtils, TSESTree } from "@typescript-eslint/utils";
45

5-
import { getId } from "../utils";
66
import { ERClassComponentFlag } from "./component-flag";
77
import type { ERClassComponent } from "./component-semantic-node";
88
import { isClassComponent, isPureComponent } from "./is";

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
import * as AST from "@eslint-react/ast";
33
import { _ } from "@eslint-react/eff";
44
import * as JSX from "@eslint-react/jsx";
5-
import type { RuleContext } from "@eslint-react/shared";
5+
import { getId, type RuleContext } from "@eslint-react/shared";
66
import type { TSESTree } from "@typescript-eslint/types";
77
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
88
import type { ESLintUtils } from "@typescript-eslint/utils";
99

1010
import { isChildrenOfCreateElement } from "../element";
1111
import { isReactHookCall } from "../hook";
12-
import { getId } from "../utils";
1312
import { DEFAULT_COMPONENT_HINT, ERComponentHint } from "./component-collector-hint";
1413
import { ERFunctionComponentFlag } from "./component-flag";
1514
import { getFunctionComponentIdentifier } from "./component-id";

packages/core/src/hook/hook-collector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as AST from "@eslint-react/ast";
22
import { _ } from "@eslint-react/eff";
3+
import { getId } from "@eslint-react/shared";
34
import type { ESLintUtils, TSESTree } from "@typescript-eslint/utils";
45

5-
import { getId } from "../utils";
66
import { isReactHookName } from "./hook-name";
77
import type { ERHook } from "./hook-semantic-node";
88
import { isReactHookCall } from "./is";

packages/core/src/utils/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from "./get-id";
21
export * from "./is-from-react";
32
export * from "./is-initialized-from-react";
43
export * from "./is-react-api";

packages/shared/docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
## Functions
4242

4343
- [defineSettings](functions/defineSettings.md)
44+
- [getId](functions/getId.md)
4445
- [getReactVersion](functions/getReactVersion.md)
4546
- [getSettingsFromContext](functions/getSettingsFromContext.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[**@eslint-react/shared**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/shared](../README.md) / getId
6+
7+
# Function: getId()
8+
9+
> **getId**(): `string`
10+
11+
## Returns
12+
13+
`string`
File renamed without changes.

packages/shared/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from "./constants";
22
export * from "./create-rule";
3+
export * from "./get-id";
34
export * from "./get-react-version";
45
export * from "./schemas";
56
export * from "./settings";

0 commit comments

Comments
 (0)