Skip to content

Commit 3becf91

Browse files
committed
docs: add "See Also" sections to various rule documentation
1 parent 0c75f0a commit 3becf91

File tree

51 files changed

+335
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+335
-5
lines changed

apps/website/content/docs/rules/meta.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"pages": [
33
"overview",
44
"------",
5+
"avoid-shorthand-boolean",
6+
"avoid-shorthand-fragment",
57
"ensure-forward-ref-using-ref",
68
"no-access-state-in-setstate",
79
"no-array-index-key",
@@ -50,11 +52,8 @@
5052
"prefer-read-only-props",
5153
"prefer-shorthand-boolean",
5254
"prefer-shorthand-fragment",
53-
"avoid-shorthand-boolean",
54-
"avoid-shorthand-fragment",
5555
"use-jsx-vars",
5656
"---DOM Rules---",
57-
"dom-no-void-elements-with-children",
5857
"dom-no-dangerously-set-innerhtml",
5958
"dom-no-dangerously-set-innerhtml-with-children",
6059
"dom-no-find-dom-node",
@@ -66,17 +65,18 @@
6665
"dom-no-unknown-property",
6766
"dom-no-unsafe-iframe-sandbox",
6867
"dom-no-unsafe-target-blank",
68+
"dom-no-void-elements-with-children",
6969
"---Web API Rules---",
7070
"web-api-no-leaked-event-listener",
7171
"web-api-no-leaked-interval",
7272
"web-api-no-leaked-resize-observer",
7373
"web-api-no-leaked-timeout",
7474
"---Hooks Extra Rules---",
75+
"hooks-extra-no-direct-set-state-in-use-effect",
76+
"hooks-extra-no-direct-set-state-in-use-layout-effect",
7577
"hooks-extra-no-unnecessary-use-callback",
7678
"hooks-extra-no-unnecessary-use-memo",
7779
"hooks-extra-no-useless-custom-hooks",
78-
"hooks-extra-no-direct-set-state-in-use-effect",
79-
"hooks-extra-no-direct-set-state-in-use-layout-effect",
8080
"hooks-extra-prefer-use-state-lazy-initialization",
8181
"---Naming Convention Rules---",
8282
"naming-convention-component-name",

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,10 @@ class MyComponent extends React.PureComponent {
5252

5353
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug/src/rules/class-component.ts)
5454
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug/src/rules/class-component.spec.ts)
55+
56+
## See Also
57+
58+
- [`function-component`](./debug-function-component)\
59+
Reports all class components.
60+
- [`hook`](./debug-hook)\
61+
Reports all React Hooks.

packages/plugins/eslint-plugin-react-debug/src/rules/function-component.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,10 @@ const MyComponent = React.forwardRef(() => <button />);
5858

5959
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug/src/rules/function-component.ts)
6060
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug/src/rules/function-component.spec.ts)
61+
62+
## See Also
63+
64+
- [`class-component`](./debug-class-component)\
65+
Reports all class components.
66+
- [`hook`](./debug-hook)\
67+
Reports all Hooks.

packages/plugins/eslint-plugin-react-debug/src/rules/hook.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@ function useToggle() {
4242

4343
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug/src/rules/hook.ts)
4444
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug/src/rules/hook.spec.ts)
45+
46+
## See Also
47+
48+
- [`class-component`](./debug-class-component)\
49+
Reports all class components.
50+
- [`function-component`](./debug-function-component)\
51+
Reports all function components.

packages/plugins/eslint-plugin-react-dom/src/rules/no-dangerously-set-innerhtml-with-children.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,8 @@ function MyComponent() {
6161

6262
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-dangerously-set-innerhtml-with-children.ts)
6363
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-dangerously-set-innerhtml-with-children.spec.ts)
64+
65+
## See Also
66+
67+
- [`no-dangerously-set-innerhtml`](./dom-no-dangerously-set-innerhtml)\
68+
Warns when using `dangerouslySetInnerHTML`.

packages/plugins/eslint-plugin-react-dom/src/rules/no-dangerously-set-innerhtml.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,8 @@ function MyComponent() {
4545

4646
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-dangerously-set-innerhtml.ts)
4747
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-dangerously-set-innerhtml.spec.ts)
48+
49+
## See Also
50+
51+
- [`no-dangerously-set-innerhtml-with-children`](./dom-no-dangerously-set-innerhtml-with-children)\
52+
Disallows `DOM element` using `children` and `dangerouslySetInnerHTML` at the same time.

packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-button-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,8 @@ function MyComponent() {
6565
## Further Reading
6666

6767
- [MDN: button - notes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#notes)
68+
69+
## See Also
70+
71+
- [`no-missing-iframe-sandbox`](./dom-no-missing-iframe-sandbox)\
72+
Enforces explicit `sandbox` attribute for `iframe` elements.

packages/plugins/eslint-plugin-react-dom/src/rules/no-missing-iframe-sandbox.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,10 @@ function MyComponent() {
6565
## Further Reading
6666

6767
- [MDN: iframe - sandbox](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attributes)
68+
69+
## See Also
70+
71+
- [`no-missing-button-type`](./dom-no-missing-button-type)\
72+
Enforces explicit `type` attribute for `button` elements.
73+
- [`no-unsafe-iframe-sandbox`](./dom-no-unsafe-iframe-sandbox)\
74+
Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations.

packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-iframe-sandbox.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@ function MyComponent() {
6868
## Further Reading
6969

7070
- [MDN: iframe - sandbox](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attributes)
71+
72+
## See Also
73+
74+
- [`no-missing-iframe-sandbox`](./dom-no-missing-iframe-sandbox)\
75+
Enforces explicit `sandbox` attribute for `iframe` elements.
76+
- [`no-unsafe-target-blank`](./dom-no-unsafe-target-blank)\
77+
Prevents the use of `target="_blank"` without `rel="noreferrer noopener"`.

packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,8 @@ function MyComponent() {
6363

6464
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.ts)
6565
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-unsafe-target-blank.spec.ts)
66+
67+
## See Also
68+
69+
- [`no-unsafe-iframe-sandbox`](./dom-no-unsafe-iframe-sandbox)\
70+
Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations.

0 commit comments

Comments
 (0)