Skip to content

Commit 57b57ba

Browse files
committed
build: set pnpm node-linker to hoisted
1 parent 328ccbe commit 57b57ba

File tree

18 files changed

+97
-31
lines changed

18 files changed

+97
-31
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
registry=https://registry.npmjs.org
22
package-manager-strict=true
33
shell-emulator=true
4+
node-linker=hoisted

packages/core/src/react-api.ts

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
1+
import type { RuleContext } from "@eslint-react/types";
2+
import type { TSESTree } from "@typescript-eslint/types";
3+
14
import { isReactAPICallWithName, isReactAPIWithName } from "./internal";
25

3-
export const isChildrenCount = isReactAPIWithName("Children", "count");
4-
export const isChildrenForEach = isReactAPIWithName("Children", "forEach");
5-
export const isChildrenMap = isReactAPIWithName("Children", "map");
6-
export const isChildrenOnly = isReactAPIWithName("Children", "only");
7-
export const isChildrenToArray = isReactAPIWithName("Children", "toArray");
8-
export const isCloneElement = isReactAPIWithName("cloneElement");
9-
export const isCreateContext = isReactAPIWithName("createContext");
10-
export const isCreateElement = isReactAPIWithName("createElement");
11-
export const isCreateRef = isReactAPIWithName("createRef");
12-
export const isForwardRef = isReactAPIWithName("forwardRef");
13-
export const isMemo = isReactAPIWithName("memo");
6+
// Workaround for @typescript-eslint/utils's TS2742 error.
7+
type A = (node: TSESTree.Identifier | TSESTree.MemberExpression, context: RuleContext) => boolean;
8+
type B = (node: TSESTree.MemberExpression, context: RuleContext, pragma?: string) => boolean;
9+
type X = (node: TSESTree.CallExpression, context: RuleContext) => boolean;
10+
type Y = (node: TSESTree.CallExpression, context: RuleContext, pragma?: string) => boolean;
11+
12+
export const isChildrenCount: B = isReactAPIWithName("Children", "count");
13+
export const isChildrenForEach: B = isReactAPIWithName("Children", "forEach");
14+
export const isChildrenMap: B = isReactAPIWithName("Children", "map");
15+
export const isChildrenOnly: B = isReactAPIWithName("Children", "only");
16+
export const isChildrenToArray: B = isReactAPIWithName("Children", "toArray");
17+
export const isCloneElement: A = isReactAPIWithName("cloneElement");
18+
export const isCreateContext: A = isReactAPIWithName("createContext");
19+
export const isCreateElement: A = isReactAPIWithName("createElement");
20+
export const isCreateRef: A = isReactAPIWithName("createRef");
21+
export const isForwardRef: A = isReactAPIWithName("forwardRef");
22+
export const isMemo: A = isReactAPIWithName("memo");
1423

15-
export const isChildrenCountCall = isReactAPICallWithName("Children", "count");
16-
export const isChildrenForEachCall = isReactAPICallWithName("Children", "forEach");
17-
export const isChildrenMapCall = isReactAPICallWithName("Children", "map");
18-
export const isChildrenOnlyCall = isReactAPICallWithName("Children", "only");
19-
export const isChildrenToArrayCall = isReactAPICallWithName("Children", "toArray");
20-
export const isCloneElementCall = isReactAPICallWithName("cloneElement");
21-
export const isCreateContextCall = isReactAPICallWithName("createContext");
22-
export const isCreateElementCall = isReactAPICallWithName("createElement");
23-
export const isCreateRefCall = isReactAPICallWithName("createRef");
24-
export const isForwardRefCall = isReactAPICallWithName("forwardRef");
25-
export const isMemoCall = isReactAPICallWithName("memo");
24+
export const isChildrenCountCall: Y = isReactAPICallWithName("Children", "count");
25+
export const isChildrenForEachCall: Y = isReactAPICallWithName("Children", "forEach");
26+
export const isChildrenMapCall: Y = isReactAPICallWithName("Children", "map");
27+
export const isChildrenOnlyCall: Y = isReactAPICallWithName("Children", "only");
28+
export const isChildrenToArrayCall: Y = isReactAPICallWithName("Children", "toArray");
29+
export const isCloneElementCall: X = isReactAPICallWithName("cloneElement");
30+
export const isCreateContextCall: X = isReactAPICallWithName("createContext");
31+
export const isCreateElementCall: X = isReactAPICallWithName("createElement");
32+
export const isCreateRefCall: X = isReactAPICallWithName("createRef");
33+
export const isForwardRefCall: X = isReactAPICallWithName("forwardRef");
34+
export const isMemoCall: X = isReactAPICallWithName("memo");

pnpm-lock.yaml

Lines changed: 48 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/bundles/core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"author": "",
1919
"license": "ISC",
2020
"devDependencies": {
21+
"tsup": "8.2.0",
2122
"@eslint-react/core": "workspace:*",
2223
"@tsconfig/node22": "22.0.0",
2324
"@tsconfig/strictest": "2.0.5"

test/bundles/plugins/eslint-plugin-react-debug/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"author": "",
1919
"license": "ISC",
2020
"devDependencies": {
21+
"tsup": "8.2.0",
2122
"eslint-plugin-react-debug": "workspace:*",
2223
"@tsconfig/node22": "22.0.0",
2324
"@tsconfig/strictest": "2.0.5"

test/bundles/plugins/eslint-plugin-react-dom/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"author": "",
1919
"license": "ISC",
2020
"devDependencies": {
21+
"tsup": "8.2.0",
2122
"eslint-plugin-react-dom": "workspace:*",
2223
"@tsconfig/node22": "22.0.0",
2324
"@tsconfig/strictest": "2.0.5"

test/bundles/plugins/eslint-plugin-react-hooks-extra/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"author": "",
1919
"license": "ISC",
2020
"devDependencies": {
21+
"tsup": "8.2.0",
2122
"eslint-plugin-react-hooks-extra": "workspace:*",
2223
"@tsconfig/node22": "22.0.0",
2324
"@tsconfig/strictest": "2.0.5"

test/bundles/plugins/eslint-plugin-react-naming-convention/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"author": "",
1919
"license": "ISC",
2020
"devDependencies": {
21+
"tsup": "8.2.0",
2122
"eslint-plugin-react-hooks-extra": "workspace:*",
2223
"@tsconfig/node22": "22.0.0",
2324
"@tsconfig/strictest": "2.0.5"

test/bundles/plugins/eslint-plugin-react-x/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"author": "",
1919
"license": "ISC",
2020
"devDependencies": {
21+
"tsup": "8.2.0",
2122
"eslint-plugin-react-x": "workspace:*",
2223
"@tsconfig/node22": "22.0.0",
2324
"@tsconfig/strictest": "2.0.5"

test/bundles/plugins/eslint-plugin/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"author": "",
1919
"license": "ISC",
2020
"devDependencies": {
21+
"tsup": "8.2.0",
2122
"@eslint-react/eslint-plugin": "workspace:*",
2223
"@tsconfig/node22": "22.0.0",
2324
"@tsconfig/strictest": "2.0.5"

0 commit comments

Comments
 (0)