|
2 | 2 | title: Presets
|
3 | 3 | ---
|
4 | 4 |
|
5 |
| -import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; |
6 |
| - |
7 | 5 | The following presets are available in `@eslint-react/eslint-plugin`:
|
8 | 6 |
|
9 |
| -<Tabs items={["Flat Config", "Legacy Config"]}> |
10 |
| - |
11 |
| - <Tab value="Flat Config"> |
12 |
| - |
13 |
| - <Callout type="info">These presets are for ESLint Flat Config (`eslint.config.js`) only.</Callout> |
14 |
| - |
15 |
| - ## Bare Bones |
16 |
| - |
17 |
| - - **Core** (`core`)\ |
18 |
| - Enable rules for `"react"`. |
19 |
| - - **DOM** (`dom`)\ |
20 |
| - Enable rules for `"react-dom"`. |
21 |
| - - **Web API** (`web-api`)\ |
22 |
| - Enable rules for interacting with Web APIs. |
23 |
| - |
24 |
| - ## General Purpose |
25 |
| - |
26 |
| - - **Recommended** (`recommended`)\ |
27 |
| - Enforce rules that are recommended by ESLint React for general purpose React + React DOM projects.\ |
28 |
| - _This preset includes the `core`, `dom`, and `web-api` presets._ |
29 |
| - |
30 |
| - ## TypeScript Specialized |
31 |
| - |
32 |
| - - **Recommended TypeScript** (`recommended-typescript`)\ |
33 |
| - Same as the `recommended` preset but disables rules that can be enforced by TypeScript. |
34 |
| - |
35 |
| - - **Recommended Type-Checked** (`recommended-type-checked`)\ |
36 |
| - Same as the `recommended-typescript` preset but enables additional rules that require type information. |
37 |
| - |
38 |
| - ## Other |
39 |
| - - **Disable DOM** (`disable-dom`)\ |
40 |
| - Disable rules in the `dom` preset. |
41 |
| - - **Disable Web API** (`disable-web-api`)\ |
42 |
| - Disable rules in the `web-api` preset. |
43 |
| - - **Disable Type-Checked** (`disable-type-checked`)\ |
44 |
| - Disable rules that require type information. |
45 |
| - - **Off** (`off`)\ |
46 |
| - Disable all rules in this plugin except for debug rules. |
47 |
| - |
48 |
| - ## Deprecated |
49 |
| - |
50 |
| - | Preset | Replaced by | |
51 |
| - | :------------------- | :-------------------------- | |
52 |
| - | Off DOM (`off-dom`) | Disable DOM (`disable-dom`) | |
53 |
| - |
54 |
| - </Tab> |
55 |
| - |
56 |
| - <Tab value="Legacy Config"> |
57 |
| - |
58 |
| - <Callout type="warn">These presets are for ESLint Legacy Config (`.eslintrc.*`) only. The Legacy Config is deprecated and not enabled by default in ESLint >= 9.0.0.</Callout> |
59 |
| - |
60 |
| - ## Bare Bones |
61 |
| - |
62 |
| - - **Core** (`core-legacy`)\ |
63 |
| - Enable rules for `"react"`. |
64 |
| - - **DOM** (`dom-legacy`)\ |
65 |
| - Enable rules for `"react-dom"`. |
66 |
| - - **Web API** (`web-api-legacy`)\ |
67 |
| - Enable rules for interacting with Web APIs. |
| 7 | +<Callout type="info">For ESLint Legacy Config (`.eslintrc.*`), add a `-legacy` suffix to the preset name (e.g. `recommended-legacy`).</Callout> |
68 | 8 |
|
69 |
| - ## General Purpose |
| 9 | +## Bare Bones |
70 | 10 |
|
71 |
| - - **Recommended** (`recommended-legacy`)\ |
72 |
| - Enforce rules that are recommended by ESLint React for general purpose React + React DOM projects.\ |
73 |
| - _This preset includes the `core`, `dom`, and `web-api` presets._ |
| 11 | +- **Core** (`core`)\ |
| 12 | + Enable rules for `"react"`. |
| 13 | +- **DOM** (`dom`)\ |
| 14 | + Enable rules for `"react-dom"`. |
| 15 | +- **Web API** (`web-api`)\ |
| 16 | + Enable rules for interacting with Web APIs. |
74 | 17 |
|
75 |
| - ## TypeScript Specialized |
| 18 | +## General Purpose |
76 | 19 |
|
77 |
| - - **Recommended TypeScript** (`recommended-typescript-legacy`)\ |
78 |
| - Same as the `recommended` preset but disables rules that can be enforced by TypeScript. |
| 20 | +- **Recommended** (`recommended`)\ |
| 21 | + Enforce rules that are recommended by ESLint React for general purpose React + React DOM projects.\ |
| 22 | + _This preset includes the `core`, `dom`, and `web-api` presets._ |
79 | 23 |
|
80 |
| - - **Recommended Type-Checked** (`recommended-type-checked-legacy`)\ |
81 |
| - Same as the `recommended-typescript` preset but enables additional rules that require type information. |
| 24 | +## TypeScript Specialized |
82 | 25 |
|
83 |
| - ## Other |
84 |
| - - **Disable DOM** (`disable-dom-legacy`)\ |
85 |
| - Disable rules in the `dom` preset. |
86 |
| - - **Disable Web API** (`disable-web-api-legacy`)\ |
87 |
| - Disable rules in the `web-api` preset. |
88 |
| - - **Disable Type-Checked** (`disable-type-checked-legacy`)\ |
89 |
| - Disable rules that require type information. |
90 |
| - - **Off** (`off-legacy`)\ |
91 |
| - Disable all rules in this plugin except for debug rules. |
| 26 | +- **Recommended TypeScript** (`recommended-typescript`)\ |
| 27 | + Same as the `recommended` preset but disables rules that can be enforced by TypeScript. |
92 | 28 |
|
93 |
| - ## Deprecated |
| 29 | +- **Recommended Type-Checked** (`recommended-type-checked`)\ |
| 30 | + Same as the `recommended-typescript` preset but enables additional rules that require type information. |
94 | 31 |
|
95 |
| - | Preset | Replaced by | |
96 |
| - | :------------------------- | :--------------------------------- | |
97 |
| - | Off DOM (`off-dom-legacy`) | Disable DOM (`disable-dom-legacy`) | |
| 32 | +## Other |
| 33 | +- **Disable DOM** (`disable-dom`)\ |
| 34 | + Disable rules in the `dom` preset. |
| 35 | +- **Disable Web API** (`disable-web-api`)\ |
| 36 | + Disable rules in the `web-api` preset. |
| 37 | +- **Disable Type-Checked** (`disable-type-checked`)\ |
| 38 | + Disable rules that require type information. |
| 39 | +- **Off** (`off`)\ |
| 40 | + Disable all rules in this plugin except for debug rules. |
98 | 41 |
|
99 |
| - </Tab> |
| 42 | +## Deprecated |
100 | 43 |
|
101 |
| -</Tabs> |
| 44 | +| Preset | Replaced by | |
| 45 | +| :------------------- | :-------------------------- | |
| 46 | +| Off DOM (`off-dom`) | Disable DOM (`disable-dom`) | |
0 commit comments