Skip to content

Commit 3f8acd0

Browse files
committed
Update comments for config presets
1 parent 6036ce2 commit 3f8acd0

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

packages/plugins/eslint-plugin-react-x/src/index.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable perfectionist/sort-objects */
12
import { getConfigAdapters } from "@eslint-react/shared";
23

34
import * as recommendedConfig from "./configs/recommended";
@@ -14,11 +15,29 @@ const { toFlatConfig } = getConfigAdapters("react-x", plugin);
1415
export default {
1516
...plugin,
1617
configs: {
18+
/**
19+
* Enforce rules that are recommended by ESLint React for general purpose React + React DOM projects
20+
*/
1721
["recommended"]: toFlatConfig(recommendedConfig),
18-
["recommended-type-checked"]: toFlatConfig(recommendedTypeCheckedConfig),
22+
/**
23+
* Same as the `recommended` preset but disables rules that can be enforced by TypeScript
24+
*/
1925
["recommended-typescript"]: toFlatConfig(recommendedTypeScriptConfig),
26+
/**
27+
* Same as the `recommended-typescript` preset but enables additional rules that require type information
28+
*/
29+
["recommended-type-checked"]: toFlatConfig(recommendedTypeCheckedConfig),
30+
/**
31+
* More strict version of the `recommended` preset
32+
*/
2033
["strict"]: toFlatConfig(strictConfig),
21-
["strict-type-checked"]: toFlatConfig(strictTypeCheckedConfig),
34+
/**
35+
* Same as the `strict` preset but enables additional rules that require type information
36+
*/
2237
["strict-typescript"]: toFlatConfig(strictTypeScriptConfig),
38+
/**
39+
* Same as the `strict-typescript` preset but enables additional rules that require type information
40+
*/
41+
["strict-type-checked"]: toFlatConfig(strictTypeCheckedConfig),
2342
},
2443
};

packages/plugins/eslint-plugin/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ ESLint React is not affiliated with Meta Corporation or [facebook/react](https:/
183183

184184
Contributions are welcome!
185185

186-
Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/main/.github/CONTRIBUTING.md).
186+
Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/fix-strict-config-export/.github/CONTRIBUTING.md).
187187

188188
## License
189189

190-
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/main/LICENSE) file for details.
190+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/fix-strict-config-export/LICENSE) file for details.

packages/plugins/eslint-plugin/src/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import * as recommendedTypeScriptConfig from "./configs/recommended-typescript";
2424
import * as strictConfig from "./configs/strict";
2525
import * as strictTypeCheckedConfig from "./configs/strict-type-checked";
2626
import * as strictTypescriptConfig from "./configs/strict-typescript";
27+
import * as webApiConfig from "./configs/web-api";
2728
import * as xConfig from "./configs/x";
2829

2930
import { padKeysLeft } from "./utils";
@@ -47,7 +48,7 @@ export default {
4748
...plugin,
4849
configs: {
4950
/**
50-
* Enable all rules in this plugin
51+
* Enable all applicable rules from this plugin
5152
*/
5253
["all"]: allConfig,
5354
/**
@@ -105,13 +106,17 @@ export default {
105106
*/
106107
["strict"]: strictConfig,
107108
/**
108-
* More strict version of the `recommended-type-checked` preset
109+
* Same as the `strict-typescript` preset but enables additional rules that require type information
109110
*/
110111
["strict-type-checked"]: strictTypeCheckedConfig,
111112
/**
112-
* More strict version of the `recommended-typescript` preset
113+
* Same as the `strict` preset but disables rules that can be enforced by TypeScript
113114
*/
114115
["strict-typescript"]: strictTypescriptConfig,
116+
/**
117+
* Enable rules for interacting with Web APIs
118+
*/
119+
["web-api"]: webApiConfig,
115120
/**
116121
* Enable rules for `"react"`
117122
*/

0 commit comments

Comments
 (0)