Skip to content

Commit f553ba3

Browse files
authored
docs: improve no-children-methods rules doc (#131)
1 parent f50720b commit f553ba3

10 files changed

+15
-17
lines changed

packages/eslint-plugin-react/src/rules/no-children-count.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
## Rule category
66

7-
Suspicious.
7+
Restriction.
88

99
## What it does
1010

1111
Prevents usage of `Children.count`.
1212

1313
## Why is this bad?
1414

15-
Using Children is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
15+
Using `Children` is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
1616

1717
## Examples
1818

packages/eslint-plugin-react/src/rules/no-children-count.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default createRule<[], MessageID>({
1919
},
2020
schema: [],
2121
messages: {
22-
NO_CHILDREN_COUNT: "Using children methods is uncommon and can lead to fragile code. Use alternatives instead.",
22+
NO_CHILDREN_COUNT: "Using `Children` is uncommon and can lead to fragile code. Use alternatives instead.",
2323
},
2424
},
2525
defaultOptions: [],

packages/eslint-plugin-react/src/rules/no-children-for-each.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
## Rule category
66

7-
Suspicious.
7+
Restriction.
88

99
## What it does
1010

1111
Prevents usage of `Children.forEach`.
1212

1313
## Why is this bad?
1414

15-
Using Children is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
15+
Using `Children` is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
1616

1717
## Examples
1818

packages/eslint-plugin-react/src/rules/no-children-for-each.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export default createRule<[], MessageID>({
1919
},
2020
schema: [],
2121
messages: {
22-
NO_CHILDREN_FOR_EACH:
23-
"Using children methods is uncommon and can lead to fragile code. Use alternatives instead.",
22+
NO_CHILDREN_FOR_EACH: "Using `Children` is uncommon and can lead to fragile code. Use alternatives instead.",
2423
},
2524
},
2625
defaultOptions: [],

packages/eslint-plugin-react/src/rules/no-children-map.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
## Rule category
66

7-
Suspicious.
7+
Restriction.
88

99
## What it does
1010

1111
Prevents usage of `Children.map`.
1212

1313
## Why is this bad?
1414

15-
Using Children is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
15+
Using `Children` is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
1616

1717
## Examples
1818

packages/eslint-plugin-react/src/rules/no-children-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default createRule<[], MessageID>({
1919
},
2020
schema: [],
2121
messages: {
22-
NO_CHILDREN_MAP: "Using children methods is uncommon and can lead to fragile code. Use alternatives instead.",
22+
NO_CHILDREN_MAP: "Using `Children` is uncommon and can lead to fragile code. Use alternatives instead.",
2323
},
2424
},
2525
defaultOptions: [],

packages/eslint-plugin-react/src/rules/no-children-only.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
## Rule category
66

7-
Suspicious.
7+
Restriction.
88

99
## What it does
1010

1111
Prevents usage of `Children.only`.
1212

1313
## Why is this bad?
1414

15-
Using Children is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
15+
Using `Children` is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
1616

1717
## Examples
1818

packages/eslint-plugin-react/src/rules/no-children-only.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default createRule<[], MessageID>({
1919
},
2020
schema: [],
2121
messages: {
22-
NO_CHILDREN_ONLY: "Using children methods is uncommon and can lead to fragile code. Use alternatives instead.",
22+
NO_CHILDREN_ONLY: "Using `Children` is uncommon and can lead to fragile code. Use alternatives instead.",
2323
},
2424
},
2525
defaultOptions: [],

packages/eslint-plugin-react/src/rules/no-children-to-array.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
## Rule category
66

7-
Suspicious.
7+
Restriction.
88

99
## What it does
1010

1111
Checks usage of `React.Children.toArray()`.
1212

1313
## Why is this bad?
1414

15-
Using Children is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
15+
Using `Children` is uncommon and can lead to fragile code. [See common alternatives](https://react.dev/reference/react/Children#alternatives).
1616

1717
## Examples
1818

packages/eslint-plugin-react/src/rules/no-children-to-array.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export default createRule<[], MessageID>({
1919
},
2020
schema: [],
2121
messages: {
22-
NO_CHILDREN_TO_ARRAY:
23-
"Using children methods is uncommon and can lead to fragile code. Use alternatives instead.",
22+
NO_CHILDREN_TO_ARRAY: "Using `Children` is uncommon and can lead to fragile code. Use alternatives instead.",
2423
},
2524
},
2625
defaultOptions: [],

0 commit comments

Comments
 (0)