From 68e6f6f005bc5efb7467158bbd03aec3ce4ec381 Mon Sep 17 00:00:00 2001 From: connorshea <2977353+connorshea@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:08:52 +0000 Subject: [PATCH] feat(linter): Implement `react/no-react-children` rule. (#20104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AI Disclosure: I used Claude Code for the implementation of the rule's `run` and `is_imported_from_react` functions. All other code (diagnostics, tests, rule docs, etc.) were written by me. Fixes #20015. Part of #1022, I guess? This rule is based on the following rules from `@eslint-react/eslint-plugin`: - [`@eslint-react/no-children-count`](https://www.eslint-react.xyz/docs/rules/no-children-count) - [`@eslint-react/no-children-for-each`](https://www.eslint-react.xyz/docs/rules/no-children-for-each) - [`@eslint-react/no-children-map`](https://www.eslint-react.xyz/docs/rules/no-children-map) - [`@eslint-react/no-children-only`](https://www.eslint-react.xyz/docs/rules/no-children-only) - [`@eslint-react/no-children-to-array`](https://www.eslint-react.xyz/docs/rules/no-children-to-array) The goal of the rule is to prevent all usage of [`React.Children`](https://react.dev/reference/react/Children), which is discouraged by the React docs. Examples of rule violations: ```jsx import { Children } from 'react'; Children.toArray(children); Children.map(children, child =>