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
24 changes: 11 additions & 13 deletions packages/core/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

## Type Aliases

- [AttributeValue](type-aliases/AttributeValue.md)
- [Component](type-aliases/Component.md)
- [ComponentDetectionHint](type-aliases/ComponentDetectionHint.md)
- [ComponentEffectPhaseKind](type-aliases/ComponentEffectPhaseKind.md)
Expand All @@ -33,7 +32,8 @@
- [ComponentPhaseKind](type-aliases/ComponentPhaseKind.md)
- [ComponentStateKind](type-aliases/ComponentStateKind.md)
- [EffectKind](type-aliases/EffectKind.md)
- [JSXDetectionHint](type-aliases/JSXDetectionHint.md)
- [JsxAttributeValue](type-aliases/JsxAttributeValue.md)
- [JsxDetectionHint](type-aliases/JsxDetectionHint.md)

## Variables

Expand Down Expand Up @@ -106,25 +106,23 @@
- [isUseStateCall](variables/isUseStateCall.md)
- [isUseSyncExternalStoreCall](variables/isUseSyncExternalStoreCall.md)
- [isUseTransitionCall](variables/isUseTransitionCall.md)
- [JSXDetectionHint](variables/JSXDetectionHint.md)
- [JsxDetectionHint](variables/JsxDetectionHint.md)
- [JsxEmit](variables/JsxEmit.md)
- [REACT\_BUILTIN\_HOOK\_NAMES](variables/REACT_BUILTIN_HOOK_NAMES.md)

## Functions

- [findParentAttribute](functions/findParentAttribute.md)
- [getAttribute](functions/getAttribute.md)
- [getAttributeName](functions/getAttributeName.md)
- [findParentJsxAttribute](functions/findParentJsxAttribute.md)
- [getComponentFlagFromInitPath](functions/getComponentFlagFromInitPath.md)
- [getComponentNameFromId](functions/getComponentNameFromId.md)
- [getElementType](functions/getElementType.md)
- [getFunctionComponentId](functions/getFunctionComponentId.md)
- [getJsxAttribute](functions/getJsxAttribute.md)
- [getJsxAttributeName](functions/getJsxAttributeName.md)
- [getJsxConfigFromAnnotation](functions/getJsxConfigFromAnnotation.md)
- [getJsxConfigFromContext](functions/getJsxConfigFromContext.md)
- [getJsxElementType](functions/getJsxElementType.md)
- [getPhaseKindOfFunction](functions/getPhaseKindOfFunction.md)
- [hasAnyAttribute](functions/hasAnyAttribute.md)
- [hasAttribute](functions/hasAttribute.md)
- [hasEveryAttribute](functions/hasEveryAttribute.md)
- [hasJsxAttribute](functions/hasJsxAttribute.md)
- [hasNoneOrLooseComponentName](functions/hasNoneOrLooseComponentName.md)
- [isAssignmentToThisState](functions/isAssignmentToThisState.md)
- [isChildrenOfCreateElement](functions/isChildrenOfCreateElement.md)
Expand All @@ -135,13 +133,13 @@
- [isComponentWrapperCall](functions/isComponentWrapperCall.md)
- [isComponentWrapperCallLoose](functions/isComponentWrapperCallLoose.md)
- [isDeclaredInRenderPropLoose](functions/isDeclaredInRenderPropLoose.md)
- [isFragmentElement](functions/isFragmentElement.md)
- [isFunctionOfComponentDidMount](functions/isFunctionOfComponentDidMount.md)
- [isFunctionOfComponentWillUnmount](functions/isFunctionOfComponentWillUnmount.md)
- [isFunctionOfRenderMethod](functions/isFunctionOfRenderMethod.md)
- [isFunctionOfUseEffectCleanup](functions/isFunctionOfUseEffectCleanup.md)
- [isFunctionOfUseEffectSetup](functions/isFunctionOfUseEffectSetup.md)
- [isHostElement](functions/isHostElement.md)
- [isJsxFragmentElement](functions/isJsxFragmentElement.md)
- [isJsxHostElement](functions/isJsxHostElement.md)
- [isJsxLike](functions/isJsxLike.md)
- [isJsxText](functions/isJsxText.md)
- [isPureComponent](functions/isPureComponent.md)
Expand All @@ -158,7 +156,7 @@
- [isRenderPropLoose](functions/isRenderPropLoose.md)
- [isThisSetState](functions/isThisSetState.md)
- [isUseEffectLikeCall](functions/isUseEffectLikeCall.md)
- [resolveAttributeValue](functions/resolveAttributeValue.md)
- [resolveJsxAttributeValue](functions/resolveJsxAttributeValue.md)
- [stringifyJsx](functions/stringifyJsx.md)
- [useComponentCollector](functions/useComponentCollector.md)
- [useComponentCollectorLegacy](functions/useComponentCollectorLegacy.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Function: findParentAttribute()
# Function: findParentJsxAttribute()

> **findParentAttribute**(`node`, `test`): `undefined` \| `JSXAttribute`
> **findParentJsxAttribute**(`node`, `test`): `undefined` \| `JSXAttribute`

Traverses up the AST to find a parent JSX attribute node that matches a given test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Function: getAttribute()
# Function: getJsxAttribute()

> **getAttribute**(`context`, `attributes`, `initialScope?`): (`name`) => `undefined` \| `TSESTreeJSXAttributeLike`
> **getJsxAttribute**(`context`, `attributes`, `initialScope?`): (`name`) => `undefined` \| `TSESTreeJSXAttributeLike`

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Function: getAttributeName()
# Function: getJsxAttributeName()

> **getAttributeName**(`context`, `node`): `string`
> **getJsxAttributeName**(`context`, `node`): `string`

Get the stringified name of a JSX attribute

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Function: getElementType()
# Function: getJsxElementType()

> **getElementType**(`context`, `node`): `string`
> **getJsxElementType**(`context`, `node`): `string`

Extracts the element type name from a JSX element or fragment
For JSX elements, returns the stringified name (e.g., "div", "Button", "React.Fragment")
Expand Down
43 changes: 0 additions & 43 deletions packages/core/docs/functions/hasAnyAttribute.md

This file was deleted.

43 changes: 0 additions & 43 deletions packages/core/docs/functions/hasEveryAttribute.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Function: hasAttribute()
# Function: hasJsxAttribute()

> **hasAttribute**(`context`, `name`, `attributes`, `initialScope?`): `boolean`
> **hasJsxAttribute**(`context`, `name`, `attributes`, `initialScope?`): `boolean`

Checks if a JSX element has a specific attribute

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Function: isFragmentElement()
# Function: isJsxFragmentElement()

> **isFragmentElement**(`context`, `node`): `node is JSXElement`
> **isJsxFragmentElement**(`context`, `node`): `node is JSXElement`

Determines if a JSX element is a React Fragment
Fragments can be imported from React and used like <Fragment> or <React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Function: isHostElement()
# Function: isJsxHostElement()

> **isHostElement**(`context`, `node`): `boolean`
> **isJsxHostElement**(`context`, `node`): `boolean`

Determines if a JSX element is a host element
Host elements in React start with lowercase letters (e.g., div, span)
Expand Down
23 changes: 0 additions & 23 deletions packages/core/docs/functions/resolveAttributeValue.md

This file was deleted.

23 changes: 23 additions & 0 deletions packages/core/docs/functions/resolveJsxAttributeValue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[**@eslint-react/core**](../README.md)

***

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

# Function: resolveJsxAttributeValue()

> **resolveJsxAttributeValue**(`context`, `attribute`): \{ `kind`: `"boolean"`; `node?`: `undefined`; `toStatic`: `true`; \} \| \{ `kind`: `"literal"`; `node`: `BigIntLiteral` \| `BooleanLiteral` \| `NullLiteral` \| `NumberLiteral` \| `RegExpLiteral` \| `StringLiteral`; `toStatic`: `null` \| `string` \| `number` \| `bigint` \| `boolean` \| [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp); \} \| \{ `kind`: `"expression"`; `node`: `JSXEmptyExpression` \| `Expression`; `toStatic`: `unknown`; \} \| \{ `kind`: `"element"`; `node`: `JSXElement`; `toStatic`: `undefined`; \} \| \{ `kind`: `"spreadChild"`; `node`: `JSXEmptyExpression` \| `Expression`; `toStatic`: `undefined`; \} \| \{ `kind`: `"spreadProps"`; `node`: `Expression`; `toStatic`: `unknown`; \}

## Parameters

### context

`RuleContext`

### attribute

`TSESTreeJSXAttributeLike`

## Returns

\{ `kind`: `"boolean"`; `node?`: `undefined`; `toStatic`: `true`; \} \| \{ `kind`: `"literal"`; `node`: `BigIntLiteral` \| `BooleanLiteral` \| `NullLiteral` \| `NumberLiteral` \| `RegExpLiteral` \| `StringLiteral`; `toStatic`: `null` \| `string` \| `number` \| `bigint` \| `boolean` \| [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp); \} \| \{ `kind`: `"expression"`; `node`: `JSXEmptyExpression` \| `Expression`; `toStatic`: `unknown`; \} \| \{ `kind`: `"element"`; `node`: `JSXElement`; `toStatic`: `undefined`; \} \| \{ `kind`: `"spreadChild"`; `node`: `JSXEmptyExpression` \| `Expression`; `toStatic`: `undefined`; \} \| \{ `kind`: `"spreadProps"`; `node`: `Expression`; `toStatic`: `unknown`; \}
11 changes: 0 additions & 11 deletions packages/core/docs/type-aliases/AttributeValue.md

This file was deleted.

11 changes: 11 additions & 0 deletions packages/core/docs/type-aliases/JsxAttributeValue.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) / JsxAttributeValue

# Type Alias: JsxAttributeValue

> **JsxAttributeValue** = \{ `kind`: `"boolean"`; `toStatic`: `true`; \} \| \{ `kind`: `"element"`; `node`: `TSESTree.JSXElement`; `toStatic`: `unknown`; \} \| \{ `kind`: `"literal"`; `node`: `TSESTree.Literal`; `toStatic`: `null` \| `string` \| `number` \| `bigint` \| `boolean` \| [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp); \} \| \{ `kind`: `"expression"`; `node`: `TSESTree.JSXExpressionContainer`\[`"expression"`\]; `toStatic`: `unknown`; \} \| \{ `kind`: `"spreadProps"`; `node`: `TSESTree.JSXSpreadAttribute`\[`"argument"`\]; `toStatic`: `unknown`; \} \| \{ `kind`: `"spreadChild"`; `node`: `TSESTree.JSXSpreadChild`\[`"expression"`\]; `toStatic`: `unknown`; \}

Represents possible JSX attribute value types that can be resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Type Alias: JSXDetectionHint
# Type Alias: JsxDetectionHint

> **JSXDetectionHint** = `bigint`
> **JsxDetectionHint** = `bigint`

BitFlags for configuring JSX detection behavior
Uses BigInt for bit operations to support many flags
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

***

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

# Variable: JSXDetectionHint
# Variable: JsxDetectionHint

> **JSXDetectionHint**: `object`
> **JsxDetectionHint**: `object`

Flags to control JSX detection behavior:
- Skip* flags: Ignore specific node types when detecting JSX
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/component/component-detection-hint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable perfectionist/sort-objects */

import { JSXDetectionHint } from "../jsx";
import { JsxDetectionHint } from "../jsx";

export type ComponentDetectionHint = bigint;

Expand All @@ -9,9 +9,9 @@ export type ComponentDetectionHint = bigint;
*/
export const ComponentDetectionHint = {
/**
* 1n << 0n - 1n << 63n are reserved for JSXDetectionHint
* 1n << 0n - 1n << 63n are reserved for JsxDetectionHint
*/
...JSXDetectionHint,
...JsxDetectionHint,
/**
* Skip function component created by React.memo
*/
Expand Down
Loading