Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/dual-react-dom-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@examples/dual-react-dom-lib",
"version": "0.0.0",
"license": "MIT",
"sideEffects": false,
"exports": {
".": {
"import": {
Expand All @@ -16,6 +17,7 @@
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist",
Expand Down Expand Up @@ -46,10 +48,8 @@
"peerDependencies": {
"react": "^19.0.0"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18.18.0"
},
"sideEffects": false,
"module": "dist/index.mjs",
"packageManager": "[email protected]"
}
}
203 changes: 3 additions & 200 deletions packages/core/docs/functions/isInitializedFromReact.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,219 +6,22 @@

# Function: isInitializedFromReact()

> **isInitializedFromReact**(`name`, `initialScope`, `settings`): `boolean`

Check if an identifier is initialized from React
> **isInitializedFromReact**(`name`, `initialScope`, `importSource`): `boolean`

## Parameters

### name

`string`

The top-level identifier's name

### initialScope

`Scope`

Initial scope to search for the identifier

### settings

ESLint React settings

#### additionalComponents

`object`[]

An array of user-defined components

**Description**

This is used to inform the ESLint React plugins how to treat these components during checks.

**Example**

```ts
`[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]`
```

#### additionalHooks

\{ `use`: `string`[]; `useActionState`: `string`[]; `useCallback`: `string`[]; `useContext`: `string`[]; `useDebugValue`: `string`[]; `useDeferredValue`: `string`[]; `useEffect`: `string`[]; `useFormStatus`: `string`[]; `useId`: `string`[]; `useImperativeHandle`: `string`[]; `useInsertionEffect`: `string`[]; `useLayoutEffect`: `string`[]; `useMemo`: `string`[]; `useOptimistic`: `string`[]; `useReducer`: `string`[]; `useRef`: `string`[]; `useState`: `string`[]; `useSyncExternalStore`: `string`[]; `useTransition`: `string`[]; \}

A object of aliases for React built-in hooks.

**Description**

ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.

**Example**

```ts
`{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }`
```

#### additionalHooks.use

`string`[]

#### additionalHooks.useActionState

`string`[]

#### additionalHooks.useCallback

`string`[]

#### additionalHooks.useContext

`string`[]

#### additionalHooks.useDebugValue

`string`[]

#### additionalHooks.useDeferredValue

`string`[]

#### additionalHooks.useEffect

`string`[]

#### additionalHooks.useFormStatus

`string`[]

#### additionalHooks.useId

`string`[]

#### additionalHooks.useImperativeHandle

`string`[]

#### additionalHooks.useInsertionEffect

`string`[]

#### additionalHooks.useLayoutEffect

`string`[]

#### additionalHooks.useMemo

`string`[]

#### additionalHooks.useOptimistic

`string`[]

#### additionalHooks.useReducer

`string`[]

#### additionalHooks.useRef
### importSource

`string`[]

#### additionalHooks.useState

`string`[]

#### additionalHooks.useSyncExternalStore

`string`[]

#### additionalHooks.useTransition

`string`[]

#### importSource

`string`

The source where React is imported from.

**Description**

This allows to specify a custom import location for React when not using the official distribution.

**Default**

`"react"`

**Example**

```ts
`"@pika/react"`
```

#### jsxPragma

`string`

The identifier that’s used for JSX Element creation.

**Default**

`"createElement"`

**Deprecated**

#### jsxPragmaFrag

`string`

The identifier that’s used for JSX fragment elements.

**Description**

This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").

**Default**

`"Fragment"`

**Deprecated**

#### polymorphicPropName

`string`

The name of the prop that is used for polymorphic components.

**Description**

This is used to determine the type of the component.

**Example**

```ts
`"as"`
```

#### version

`string`

React version to use, "detect" means auto detect React version from the project’s dependencies.
If `importSource` is specified, an equivalent version of React should be provided here.

**Example**

```ts
`"18.3.1"`
```

**Default**

`"detect"`
`string` = `"react"`

## Returns

`boolean`

Whether the identifier is initialized from React
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"license": "MIT",
"author": "Eva1ent<[email protected]>",
"sideEffects": false,
"exports": {
".": {
"import": {
Expand All @@ -27,6 +28,7 @@
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist",
Expand Down Expand Up @@ -59,7 +61,5 @@
"engines": {
"bun": ">=1.0.15",
"node": ">=18.18.0"
},
"sideEffects": false,
"module": "dist/index.mjs"
}
}
Loading
Loading