Skip to content

refactor(core): add createElement helper APIs and reuse them in rules - #1937

Merged
Rel1cx merged 1 commit into
mainfrom
refactor/core-create-element-helpers
Aug 13, 2026
Merged

refactor(core): add createElement helper APIs and reuse them in rules#1937
Rel1cx merged 1 commit into
mainfrom
refactor/core-create-element-helpers

Conversation

@Rel1cx

@Rel1cx Rel1cx commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Update "[ ]" to "[x]" to check a box

What kind of change does this PR introduce?

Check at least one. If you are introducing a new binding, you must reference an issue where this binding has been proposed, discussed and approved by the maintainers.

  • Bugfix
  • Feature
  • Perf
  • Docs
  • Test
  • Chore
  • Enhancement
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

If yes, please describe the impact and migration path for existing applications in an attached issue.

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • I have added a convincing reason for adding this feature, if necessary

Other information

  • Add a new create-element module to @eslint-react/core with getCreateElementTypeArgument, getCreateElementPropsObject, getCreateElementChildrenArguments, getCreateElementProp, isCreateElementChildrenArgument and isInsideCreateElementProps, plus tests and generated docs.
  • Replace dual from @local/eff with hand-rolled overloads in api.ts, preserving both the direct and curried call signatures (including the isAPICall type guard).
  • Reuse the new helpers in no-children-prop, no-children-prop-with-children, no-array-index-key and no-nested-component-definitions, dropping the duplicated find-create-element-children-prop util and the local isInsideCreateElementProps.
  • no-array-index-key now also inspects createElement props wrapped in type expressions (e.g. { key: i } as const) via getCreateElementPropsObject; cloneElement handling is unchanged.

- add create-element module with getCreateElementTypeArgument,
  getCreateElementPropsObject, getCreateElementChildrenArguments,
  getCreateElementProp, isCreateElementChildrenArgument and
  isInsideCreateElementProps
- replace dual from @local/eff with hand-rolled overloads in api.ts
- reuse the new helpers in no-children-prop,
  no-children-prop-with-children, no-array-index-key and
  no-nested-component-definitions, dropping duplicated local utils
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
eslint-react Building Building Preview Aug 13, 2026 5:37am

@Rel1cx
Rel1cx merged commit 8d478b6 into main Aug 13, 2026
10 of 11 checks passed
@Rel1cx
Rel1cx deleted the refactor/core-create-element-helpers branch August 13, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant