Skip to content

Commit d4373ab

Browse files
authored
Update recommended presets, closes #1251 (#1252)
1 parent ce45d64 commit d4373ab

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ full: true
140140
| [`context-name`](./naming-convention-context-name) | 1️⃣ | | Enforces context name to be a valid component name with the suffix `Context` |
141141
| [`filename`](./naming-convention-filename) | 0️⃣ | `⚙️` | Enforces consistent file naming conventions |
142142
| [`filename-extension`](./naming-convention-filename-extension) | 0️⃣ | `⚙️` | Enforces consistent use of the JSX file extension |
143-
| [`use-state`](./naming-convention-use-state) | 0️⃣ | | Enforces destructuring and symmetric naming of `useState` hook value and setter |
143+
| [`use-state`](./naming-convention-use-state) | 1️⃣ | | Enforces destructuring and symmetric naming of `useState` hook value and setter |
144144

145145
## Debug Rules
146146

packages/plugins/eslint-plugin-react-naming-convention/src/configs/recommended.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export const name = "react-naming-convention/recommended";
44

55
export const rules = {
66
"react-naming-convention/context-name": "warn",
7-
// "react-naming-convention/use-state": "warn",
7+
"react-naming-convention/use-state": "warn",
88
} as const satisfies Record<string, RuleConfig>;

packages/plugins/eslint-plugin-react-naming-convention/src/rules/use-state.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ react-naming-convention/use-state
1414
@eslint-react/naming-convention/use-state
1515
```
1616

17+
**Presets**
18+
19+
- `recommended`
20+
- `recommended-typescript`
21+
- `recommended-type-checked`
22+
1723
## Description
1824

1925
Enforces destructuring and symmetric naming of `useState` hook value and setter.

packages/plugins/eslint-plugin/src/configs/recommended.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export const rules = {
1313
...x.rules,
1414
...dom.rules,
1515
...webApi.rules,
16-
16+
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
1717
"@eslint-react/naming-convention/context-name": "warn",
18-
// "@eslint-react/naming-convention/use-state": "warn",
18+
"@eslint-react/naming-convention/use-state": "warn",
1919
} as const satisfies Record<string, RuleConfig>;
2020

2121
export const plugins = {

0 commit comments

Comments
 (0)