Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/website/content/docs/rules/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ full: true
| [`context-name`](./naming-convention-context-name) | 1️⃣ | | Enforces context name to be a valid component name with the suffix `Context` |
| [`filename`](./naming-convention-filename) | 0️⃣ | `⚙️` | Enforces consistent file naming conventions |
| [`filename-extension`](./naming-convention-filename-extension) | 0️⃣ | `⚙️` | Enforces consistent use of the JSX file extension |
| [`use-state`](./naming-convention-use-state) | 0️⃣ | | Enforces destructuring and symmetric naming of `useState` hook value and setter |
| [`use-state`](./naming-convention-use-state) | 1️⃣ | | Enforces destructuring and symmetric naming of `useState` hook value and setter |

## Debug Rules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export const name = "react-naming-convention/recommended";

export const rules = {
"react-naming-convention/context-name": "warn",
// "react-naming-convention/use-state": "warn",
"react-naming-convention/use-state": "warn",
} as const satisfies Record<string, RuleConfig>;
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ react-naming-convention/use-state
@eslint-react/naming-convention/use-state
```

**Presets**

- `recommended`
- `recommended-typescript`
- `recommended-type-checked`

## Description

Enforces destructuring and symmetric naming of `useState` hook value and setter.
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin/src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const rules = {
...x.rules,
...dom.rules,
...webApi.rules,

"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
"@eslint-react/naming-convention/context-name": "warn",
// "@eslint-react/naming-convention/use-state": "warn",
"@eslint-react/naming-convention/use-state": "warn",
} as const satisfies Record<string, RuleConfig>;

export const plugins = {
Expand Down