Skip to content

Commit b86bdd6

Browse files
Rel1cxclaude
andauthored
feat(jsx): add jsx-no-leaked-dollar rule, add suggest fix to jsx-no-leaked-semicolon rule (#1688)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bb0feb2 commit b86bdd6

13 files changed

Lines changed: 702 additions & 194 deletions

File tree

apps/website/content/docs/rules/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"jsx-no-children-prop-with-children",
6565
"jsx-no-comment-textnodes",
6666
"jsx-no-key-after-spread",
67+
"jsx-no-leaked-dollar",
6768
"jsx-no-leaked-semicolon",
6869
"jsx-no-namespace",
6970
"jsx-no-useless-fragment",

apps/website/content/docs/rules/overview.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,16 @@ full: true
8787
JSX rules check for issues exclusive to JSX syntax, which are absent from standard JavaScript (like handwritten `createElement()` calls).
8888
</Callout>
8989

90-
| Rule || 🌟 | Description | `react` |
91-
| :--------------------------------------------------------------------- | :-----: | :-------: | :---------------------------------------------------------------------------------------- | :-----: |
92-
| [`no-children-prop`](jsx-no-children-prop) | 1️⃣ 2️⃣ | `🔧` | Disallows passing `children` as a prop | |
93-
| [`no-children-prop-with-children`](jsx-no-children-prop-with-children) | 2️⃣ 2️⃣ | `🔧` | Disallows passing `children` as a prop when children are also passed as nested content | |
94-
| [`no-comment-textnodes`](jsx-no-comment-textnodes) | 1️⃣ 1️⃣ | | Prevents comment strings from being accidentally inserted into a JSX element's text nodes | |
95-
| [`no-useless-fragment`](jsx-no-useless-fragment) | 0️⃣ 1️⃣ | `🔧` `⚙️` | Disallows useless fragment elements | |
96-
| [`no-key-after-spread`](jsx-no-key-after-spread) | 2️⃣ 2️⃣ | | Prevent patterns that cause deoptimization when using the automatic JSX runtime | |
97-
| [`no-namespace`](jsx-no-namespace) | 2️⃣ 2️⃣ | | Disallow JSX namespace syntax, as React does not support them | |
90+
| Rule || 🌟 | Description | `react` |
91+
| :--------------------------------------------------------------------- | :-----: | :-------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-----: |
92+
| [`no-children-prop`](jsx-no-children-prop) | 1️⃣ 2️⃣ | `🔧` | Disallows passing `children` as a prop | |
93+
| [`no-children-prop-with-children`](jsx-no-children-prop-with-children) | 2️⃣ 2️⃣ | `🔧` | Disallows passing `children` as a prop when children are also passed as nested content | |
94+
| [`no-comment-textnodes`](jsx-no-comment-textnodes) | 1️⃣ 1️⃣ | | Prevents comment strings from being accidentally inserted into a JSX element's text nodes | |
95+
| [`no-key-after-spread`](jsx-no-key-after-spread) | 2️⃣ 2️⃣ | | Prevent patterns that cause deoptimization when using the automatic JSX runtime | |
96+
| [`no-leaked-dollar`](jsx-no-leaked-dollar) | 0️⃣ 0️⃣ | `🔧` | Catches `$` before `{expr}` in JSX — typically from template literal `${expr}` being copy-pasted into JSX without removing the `$`. The `$` "leaks" into the rendered output | |
97+
| [`no-leaked-semicolon`](jsx-no-leaked-semicolon) | 1️⃣ 1️⃣ | `🔧` | Catches `;` at the start of JSX text nodes — typically from accidentally placing a statement-ending `;` inside JSX. The `;` "leaks" into the rendered output | |
98+
| [`no-namespace`](jsx-no-namespace) | 2️⃣ 2️⃣ | | Disallow JSX namespace syntax, as React does not support them | |
99+
| [`no-useless-fragment`](jsx-no-useless-fragment) | 0️⃣ 1️⃣ | `🔧` `⚙️` | Disallows useless fragment elements | |
98100

99101
## RSC Rules
100102

0 commit comments

Comments
 (0)