Skip to content

Commit dc4d09a

Browse files
committed
docs: update 'no-class-component' rule description to clarify exception for error boundaries
1 parent 8e1d189 commit dc4d09a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Linter rules can have false positives, false negatives, and some rules are depen
3737
| [`no-children-only`](./no-children-only) | 1️⃣ | | Disallow `Children.only` | |
3838
| [`no-children-prop`](./no-children-prop) | 0️⃣ | | Disallow passing `children` as a prop | |
3939
| [`no-children-to-array`](./no-children-to-array) | 1️⃣ | | Disallow `Children.toArray` | |
40-
| [`no-class-component`](./no-class-component) | 0️⃣ | | Disallow class component | |
40+
| [`no-class-component`](./no-class-component) | 0️⃣ | | Disallow class components except for error boundaries | |
4141
| [`no-clone-element`](./no-clone-element) | 1️⃣ | | Disallow `cloneElement` | |
4242
| [`no-comment-textnodes`](./no-comment-textnodes) | 1️⃣ | | Prevents comments from being inserted as text nodes | |
4343
| [`no-complex-conditional-rendering`](./no-complex-conditional-rendering) | 0️⃣ | `🧪` | Disallow complex conditional rendering in JSX expressions | |

packages/plugins/eslint-plugin-react-x/src/rules/no-class-component.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ react-x/no-class-component
2323

2424
## Description
2525

26-
Disallow class components.
26+
Disallow class components except for error boundaries.
2727

2828
Component is the base class for the React components defined as JavaScript classes. Class components are still supported by React, but we don’t recommend using them in new code.
2929

packages/plugins/eslint-plugin-react-x/src/rules/no-class-component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export default createRule<[], MessageID>({
1515
meta: {
1616
type: "problem",
1717
docs: {
18-
description: "Disallow class components.",
18+
description: "Disallow class components except for error boundaries.",
1919
[Symbol.for("rule_features")]: RULE_FEATURES,
2020
},
2121
messages: {
22-
noClassComponent: "Do not use class components. Use function components instead.",
22+
noClassComponent: "Avoid using class components. Use function components instead.",
2323
},
2424
schema: [],
2525
},

0 commit comments

Comments
 (0)