Skip to content

Commit 1b522e7

Browse files
committed
Minor docs improvements
1 parent ba8ce72 commit 1b522e7

File tree

9 files changed

+227
-209
lines changed

9 files changed

+227
-209
lines changed

packages/core/docs/@eslint-react/namespaces/isReactAPI/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
## Type Aliases
66

7-
- [ReturnType](type-aliases/ReturnType.md)
7+
| Type Alias | Description |
8+
| ------ | ------ |
9+
| [ReturnType](type-aliases/ReturnType.md) | - |

packages/core/docs/@eslint-react/namespaces/isReactAPICall/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
## Type Aliases
66

7-
- [ReturnType](type-aliases/ReturnType.md)
7+
| Type Alias | Description |
8+
| ------ | ------ |
9+
| [ReturnType](type-aliases/ReturnType.md) | - |

packages/core/docs/@eslint-react/namespaces/useComponentCollector/README.md

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

55
## Type Aliases
66

7-
- [Options](type-aliases/Options.md)
8-
- [ReturnType](type-aliases/ReturnType.md)
7+
| Type Alias | Description |
8+
| ------ | ------ |
9+
| [Options](type-aliases/Options.md) | - |
10+
| [ReturnType](type-aliases/ReturnType.md) | - |

packages/core/docs/@eslint-react/namespaces/useComponentCollectorLegacy/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
## Type Aliases
66

7-
- [ReturnType](type-aliases/ReturnType.md)
7+
| Type Alias | Description |
8+
| ------ | ------ |
9+
| [ReturnType](type-aliases/ReturnType.md) | - |

packages/core/docs/@eslint-react/namespaces/useHookCollector/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
## Type Aliases
66

7-
- [ReturnType](type-aliases/ReturnType.md)
7+
| Type Alias | Description |
8+
| ------ | ------ |
9+
| [ReturnType](type-aliases/ReturnType.md) | - |

packages/core/docs/README.md

Lines changed: 147 additions & 137 deletions
Large diffs are not rendered by default.

packages/core/typedoc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
"entryPoints": [
77
"src/index.ts"
88
],
9-
"indexFormat": "list",
109
"out": "docs"
1110
}

packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-use-callback.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ function MyComponent() {
4747
}
4848
```
4949

50-
5150
```tsx
5251
import { Button, MantineTheme } from "@mantine/core";
5352
import React, { useCallback, useEffect } from "react";
Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
---
2-
title: no-unnecessary-use-memo
3-
---
4-
5-
**Full Name in `@eslint-react/eslint-plugin`**
6-
7-
```plain copy
8-
@eslint-react/no-unnecessary-use-memo
9-
```
10-
11-
**Full Name in `eslint-plugin-react-x`**
12-
13-
```plain copy
14-
react-x/no-unnecessary-use-memo
15-
```
16-
17-
**Features**
18-
19-
`🧪`
20-
21-
**Presets**
22-
1+
---
2+
title: no-unnecessary-use-memo
3+
---
4+
5+
**Full Name in `@eslint-react/eslint-plugin`**
6+
7+
```plain copy
8+
@eslint-react/no-unnecessary-use-memo
9+
```
10+
11+
**Full Name in `eslint-plugin-react-x`**
12+
13+
```plain copy
14+
react-x/no-unnecessary-use-memo
15+
```
16+
17+
**Features**
18+
19+
`🧪`
20+
21+
**Presets**
22+
2323
`strict`
2424
`strict-typescript`
25-
`strict-type-checked`
26-
27-
## Description
28-
29-
Disallow unnecessary usage of `useMemo`.
30-
31-
React Hooks `useMemo` has empty dependencies array like what's in the examples, are unnecessary. The hook can be removed and it's value can be calculated in the component body or hoisted to the outer scope of the component.
32-
If the calculated variable is only used inside one useEffect the calculation can be moved inside the useEffect Function.
33-
34-
## Examples
35-
36-
### Failing
37-
38-
```tsx
25+
`strict-type-checked`
26+
27+
## Description
28+
29+
Disallow unnecessary usage of `useMemo`.
30+
31+
React Hooks `useMemo` has empty dependencies array like what's in the examples, are unnecessary. The hook can be removed and it's value can be calculated in the component body or hoisted to the outer scope of the component.
32+
If the calculated variable is only used inside one useEffect the calculation can be moved inside the useEffect Function.
33+
34+
## Examples
35+
36+
### Failing
37+
38+
```tsx
3939
import { Button, MantineTheme } from "@mantine/core";
4040
import React, { useMemo } from "react";
4141

@@ -49,10 +49,10 @@ function MyComponent() {
4949
[],
5050
);
5151
return <Button sx={style} />;
52-
}
53-
```
54-
55-
```tsx
52+
}
53+
```
54+
55+
```tsx
5656
import { Button, MantineTheme } from "@mantine/core";
5757
import React, { useMemo, useEffect } from "react";
5858

@@ -66,12 +66,12 @@ function MyComponent({someNumbers}: {someNumbers: number[]}) {
6666
console.log(calculatedNumber)
6767
}, [calculatedNumber])
6868
return <div> Hello World! </div>;
69-
}
70-
```
71-
72-
### Passing
73-
74-
```tsx
69+
}
70+
```
71+
72+
### Passing
73+
74+
```tsx
7575
import { Button, MantineTheme } from "@mantine/core";
7676
import React from "react";
7777

@@ -83,10 +83,10 @@ const style = (theme: MantineTheme) => ({
8383

8484
function MyComponent() {
8585
return <Button sx={style} />;
86-
}
87-
```
88-
89-
```tsx
86+
}
87+
```
88+
89+
```tsx
9090
import { Button, MantineTheme } from "@mantine/core";
9191
import React, { useEffect } from "react";
9292

@@ -96,17 +96,17 @@ function MyComponent({someNumbers}: {someNumbers: number[]}) {
9696
console.log(calculatedNumber)
9797
}, [someNumbers])
9898
return <div> Hello World! </div>;
99-
}
100-
```
101-
102-
## Implementation
103-
104-
- [Rule Source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-use-memo.ts)
105-
- [Test Source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-use-memo.spec.ts)
106-
107-
---
108-
109-
## See Also
110-
111-
- [`no-unnecessary-use-callback`](./no-unnecessary-use-callback)\
112-
Disallows unnecessary usage of `useCallback`.
99+
}
100+
```
101+
102+
## Implementation
103+
104+
- [Rule Source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-use-memo.ts)
105+
- [Test Source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-use-memo.spec.ts)
106+
107+
---
108+
109+
## See Also
110+
111+
- [`no-unnecessary-use-callback`](./no-unnecessary-use-callback)\
112+
Disallows unnecessary usage of `useCallback`.

0 commit comments

Comments
 (0)