Skip to content

Commit 31c3757

Browse files
authored
docs: improve jsx-related docs (#1088)
1 parent e2a2ed2 commit 31c3757

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

apps/website/content/docs/configuration/configure-language-config.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: "Configure Language Config"
44

55
import { JSXConfigTypeTable } from "./configure-language-config";
66

7-
ESLint React references your language config to determine how to perform static code analysis. This page details which parts of ESLint React utilize your language config.
7+
ESLint React uses your language configuration (`tsconfig.json`/`jsconfig.json`) for static analysis. Learn which specific features use this config here.
88

9-
## JSX Runtime
9+
## JSX Transform
1010

11-
ESLint React reads your `tsconfig.json` or `jsconfig.json` configuration file to determine the JSX runtime type.
11+
ESLint React uses your compiler options to determine the JSX transform you are using. This is important for linting JSX syntax correctly.
1212

1313
The following [compiler options](https://www.typescriptlang.org/tsconfig/#compilerOptions) are respected:
1414

apps/website/content/docs/faq.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,19 @@ You can view our long-term plans on the [roadmap](/roadmap#plugins-with-ecologic
5353

5454
</Accordion>
5555

56-
<Accordion title='Why is there no "jsx-runtime" preset?'>
56+
<Accordion title="Why is there no 'jsx-runtime' preset?">
5757

58-
ESLint React reads your `tsconfig.json` or `jsconfig.json` configuration files to determines how to perform the JSX analysis internally. This means that you don't need to configure the JSX runtime in ESLint React, as it will automatically use the one configured in your project.
58+
ESLint React automatically detects your JSX transform configuration from `tsconfig.json` or `jsconfig.json` by reading `compilerOptions` (like `jsx`, `jsxImportSource`, etc.).
5959

60-
Additionally, this approach avoids potential problems where the JSX runtime configured in `eslint.config.js` might conflict with the one configured in `tsconfig.json` or `jsconfig.json`.
60+
If these aren't set, it defaults to the `automatic` transform (React 17+), which uses `jsx-runtime` internally and doesn't require importing React.
6161

62-
For more information, see the [JSX Runtime](/docs/configuration/configure-language-config#jsx-runtime) section on the [Configure Language Config](/docs/configuration/configure-language-config) page.
62+
Because the plugin automatically adapts to your settings or uses the appropriate default, a specific `'jsx-runtime'` preset isn't needed.
63+
64+
For more details, see the [Configure Language Config](/docs/configuration/configure-language-config) page.
6365

6466
</Accordion>
6567

66-
<Accordion title="Is there anything to note about migrating from eslint-plugin-react?">
68+
<Accordion title="Is there anything to note about migrating from 'eslint-plugin-react'?">
6769

6870
Please be aware that some rules may behave differently when transitioning to ESLint React. The rules in ESLint React are more closely aligned with the guidelines provided by [react.dev](https://react.dev). This alignment is due to ESLint React adopting [react.dev](https://react.dev) as its primary reference, rather than `eslint-plugin-react`.
6971

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ Linter rules can have false positives, false negatives, and some rules are depen
2323

2424
## X Rules
2525

26+
<Callout type="info" title="TIP">
27+
28+
Rules prefixed with `jsx-` check for issues exclusive to JSX syntax, which are absent from standard JavaScript code (like handwritten `createElement()` calls).
29+
30+
</Callout>
31+
2632
| Rule || 🌟 | Description | `react` |
2733
| :----------------------------------------------------------------------------------- | :-- | :-------: | :-------------------------------------------------------------------------------------------------- | :------: |
2834
| [`jsx-no-duplicate-props`](./jsx-no-duplicate-props) | 1️⃣ | | Disallow duplicate props in JSX elements | |

0 commit comments

Comments
 (0)