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
30 changes: 10 additions & 20 deletions apps/website/content/docs/configuration/configure-analyzer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default [

Defines the React version for semantic analysis.

- `"detect"`: Auto-detects from project dependencies (defaults to `19.1.0` if undetectable)
- `detect`: Auto-detects from project dependencies (defaults to `19.1.0` if undetectable)
- `string`: Explicit version specification (e.g., `"18.3.1"`)

### `importSource`
Expand All @@ -45,20 +45,6 @@ Example for using `@pika/react` instead of `react`:
import React from "@pika/react";
```

### `skipImportCheck`

Controls whether to verify the import source when identifying React APIs.

Default is `true` (checks only API shape). When `false`, both shape and import source are verified, preventing false positives from third-party libraries with similar APIs.

```ts
import { memo } from "unrelated-library";

const NonComponentFunction = memo(() => {
// When skipImportCheck: false, this isn't recognized as React's memo
});
```

### `polymorphicPropName`

Defines the prop used for polymorphic components. Helps rules determine element types for semantic context.
Expand All @@ -73,10 +59,13 @@ Example with `polymorphicPropName` set to `as`:
### `additionalComponents` (Experimental)

<Callout type="info">
Consider using `polymorphicPropName` instead when possible, as it's simpler and more efficient.
Consider using `polymorphicPropName` instead when possible, as it's simpler
and more efficient.
</Callout>

<Callout type="warn">Experimental feature that may lack stability and documentation.</Callout>
<Callout type="warn">
Experimental feature that may lack stability and documentation.
</Callout>

Maps components and their attributes for comprehensive analysis. Supports default attribute values.

Expand All @@ -102,9 +91,10 @@ This makes `<EmbedContent src="https://eslint-react.xyz" />{:tsx}` evaluate as `
### `additionalHooks` (Experimental)

<Callout type="warn">
Intended for edge cases. We suggest to use this option **very sparingly, if at all**. Generally saying, we recommend
most custom Hooks do not vary the built-in React Hooks, and instead provide a higher-level API that is more focused
around a specific use case.
Intended for edge cases. We suggest to use this option **very sparingly, if at
all**. Generally saying, we recommend most custom Hooks do not vary the
built-in React Hooks, and instead provide a higher-level API that is more
focused around a specific use case.
</Callout>

Alias variants to built-in React Hooks for rule compatibility:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ export function AnalyzerPropertyTypeTable() {
description: <Link href="#importsource">The source where React is imported from ⤵</Link>,
default: '"react"',
},
skipImportCheck: {
type: "boolean",
description: (
<Link href="#skipimportcheck">
When determining whether an API originates from React, bypass the import source check. ⤵
</Link>
),
default: "true",
},
polymorphicPropName: {
type: "string",
description: (
Expand Down
3 changes: 2 additions & 1 deletion apps/website/content/docs/presets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ title: Presets
The following presets are available in `@eslint-react/eslint-plugin`:

<Callout type="info">
For ESLint Legacy Config (`.eslintrc.*`), add a `-legacy` suffix to the preset name (e.g. `recommended-legacy`).
For ESLint Legacy Config (`.eslintrc.*`), add a `-legacy` suffix to the preset
name (e.g. `recommended-legacy`).
</Callout>

## Bare Bones
Expand Down
8 changes: 4 additions & 4 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"@chevrotain/regexp-to-ast": "^11.0.3",
"bsky-react-post": "^0.1.7",
"clsx": "^2.1.1",
"fumadocs-core": "15.2.6",
"fumadocs-core": "15.2.7",
"fumadocs-docgen": "2.0.0",
"fumadocs-mdx": "11.5.8",
"fumadocs-twoslash": "3.1.0",
"fumadocs-mdx": "11.6.0",
"fumadocs-twoslash": "3.1.1",
"fumadocs-typescript": "4.0.2",
"fumadocs-ui": "15.2.6",
"fumadocs-ui": "15.2.7",
"lucide-react": "^0.488.0",
"next": "^15.3.0",
"next-view-transitions": "^0.3.4",
Expand Down
22 changes: 20 additions & 2 deletions apps/website/source.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { remarkMermaid } from "@theguild/remark-mermaid";
import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
import { remarkDocGen, remarkInstall } from "fumadocs-docgen";
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
import { transformerTwoslash } from "fumadocs-twoslash";
import { remarkMermaid } from "@theguild/remark-mermaid";

export const docs = defineDocs({
dir: "content/docs",
Expand All @@ -14,7 +14,25 @@ export default defineConfig({
rehypeCodeOptions: {
experimentalJSEngine: true,
inline: "tailing-curly-colon",
langs: ["js", "ts", "jsx", "tsx", "html", "md", "mdx", "css", "json", "yaml"],
langs: [
"bash",
"css",
"html",
"js",
"json",
"jsx",
"lisp",
"log",
"md",
"mdx",
"regexp",
"sh",
"shell",
"ts",
"tsx",
"yaml",
"diff",
],
lazy: true,
themes: {
dark: "github-dark",
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import url from "node:url";
import markdown from "@eslint/markdown";
import * as configs from "@local/configs/eslint";
import pluginLocal from "@local/eslint-plugin-local";
import configFlatGitignore from "eslint-config-flat-gitignore";
import gitIgnores from "eslint-config-flat-gitignore";
import pluginVitest from "eslint-plugin-vitest";
import { globalIgnores } from "eslint/config";
import tseslint from "typescript-eslint";
Expand All @@ -22,7 +22,6 @@ const GLOB_TEST = [
const GLOB_CONFIG = ["*.config.{ts,tsx,cts,mts}", "**/*.config.{ts,tsx,cts,mts}"];
const GLOB_SCRIPT = ["scripts/**/*.{ts,cts,mts}"];
const GLOB_IGNORES = [
...configFlatGitignore().ignores,
"apps",
"docs",
"test",
Expand All @@ -36,6 +35,7 @@ const packagesTsConfigs = [
];

export default tseslint.config(
gitIgnores(),
globalIgnores(GLOB_IGNORES),
{
extends: [
Expand Down
11 changes: 11 additions & 0 deletions packages/core/docs/@eslint-react/namespaces/isReactAPI/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[**@eslint-react/core**](../../../README.md)

***

[@eslint-react/core](../../../README.md) / isReactAPI

# isReactAPI

## Type Aliases

- [ReturnType](type-aliases/ReturnType.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[**@eslint-react/core**](../../../../README.md)

***

[@eslint-react/core](../../../../README.md) / [isReactAPI](../README.md) / ReturnType

# Type Alias: ReturnType()

> **ReturnType** = \{(`context`, `node`): `boolean`; (`context`): (`node`) => `boolean`; \}

## Call Signature

> (`context`, `node`): `boolean`

### Parameters

#### context

`RuleContext`

#### node

`undefined` | `null` | `Node`

### Returns

`boolean`

## Call Signature

> (`context`): (`node`) => `boolean`

### Parameters

#### context

`RuleContext`

### Returns

> (`node`): `boolean`

#### Parameters

##### node

`undefined` | `null` | `Node`

#### Returns

`boolean`
1 change: 1 addition & 0 deletions packages/core/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## Namespaces

- [isReactAPI](@eslint-react/namespaces/isReactAPI/README.md)
- [useComponentCollector](@eslint-react/namespaces/useComponentCollector/README.md)
- [useComponentCollectorLegacy](@eslint-react/namespaces/useComponentCollectorLegacy/README.md)
- [useHookCollector](@eslint-react/namespaces/useHookCollector/README.md)
Expand Down
30 changes: 5 additions & 25 deletions packages/core/docs/functions/isReactAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,14 @@

# Function: isReactAPI()

## Call Signature
> **isReactAPI**(`api`): [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)

> **isReactAPI**(`name`): `ReturnType`
## Parameters

### Parameters

#### name

`string`

### Returns

`ReturnType`

## Call Signature

> **isReactAPI**(`objectName`, `propertyName`): `ReturnType`

### Parameters

#### objectName

`string`

#### propertyName
### api

`string`

### Returns
## Returns

`ReturnType`
[`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
30 changes: 5 additions & 25 deletions packages/core/docs/functions/isReactAPICall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,14 @@

# Function: isReactAPICall()

## Call Signature
> **isReactAPICall**(`api`): [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)

> **isReactAPICall**(`name`): `ReturnType`
## Parameters

### Parameters

#### name

`string`

### Returns

`ReturnType`

## Call Signature

> **isReactAPICall**(`objectName`, `propertyName`): `ReturnType`

### Parameters

#### objectName

`string`

#### propertyName
### api

`string`

### Returns
## Returns

`ReturnType`
[`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isCaptureOwnerStack.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isCaptureOwnerStack

> `const` **isCaptureOwnerStack**: `ReturnType`
> `const` **isCaptureOwnerStack**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isCaptureOwnerStackCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isCaptureOwnerStackCall

> `const` **isCaptureOwnerStackCall**: `ReturnType`
> `const` **isCaptureOwnerStackCall**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenCount.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenCount

> `const` **isChildrenCount**: `ReturnType`
> `const` **isChildrenCount**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenCountCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenCountCall

> `const` **isChildrenCountCall**: `ReturnType`
> `const` **isChildrenCountCall**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenForEach.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenForEach

> `const` **isChildrenForEach**: `ReturnType`
> `const` **isChildrenForEach**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenForEachCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenForEachCall

> `const` **isChildrenForEachCall**: `ReturnType`
> `const` **isChildrenForEachCall**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenMap

> `const` **isChildrenMap**: `ReturnType`
> `const` **isChildrenMap**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenMapCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenMapCall

> `const` **isChildrenMapCall**: `ReturnType`
> `const` **isChildrenMapCall**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenOnly.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenOnly

> `const` **isChildrenOnly**: `ReturnType`
> `const` **isChildrenOnly**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenOnlyCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenOnlyCall

> `const` **isChildrenOnlyCall**: `ReturnType`
> `const` **isChildrenOnlyCall**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenToArray.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenToArray

> `const` **isChildrenToArray**: `ReturnType`
> `const` **isChildrenToArray**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isChildrenToArrayCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isChildrenToArrayCall

> `const` **isChildrenToArrayCall**: `ReturnType`
> `const` **isChildrenToArrayCall**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
2 changes: 1 addition & 1 deletion packages/core/docs/variables/isCloneElement.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# Variable: isCloneElement

> `const` **isCloneElement**: `ReturnType`
> `const` **isCloneElement**: [`ReturnType`](../@eslint-react/namespaces/isReactAPI/type-aliases/ReturnType.md)
Loading
Loading