Skip to content

Commit 49f052b

Browse files
authored
refactor: code optimizations (#1037)
1 parent a0b4a39 commit 49f052b

27 files changed

+527
-32
lines changed

packages/core/docs/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,28 @@
9595
- [isClassComponent](functions/isClassComponent.md)
9696
- [isComponentDidCatch](functions/isComponentDidCatch.md)
9797
- [isComponentDidMount](functions/isComponentDidMount.md)
98+
- [isComponentDidUpdate](functions/isComponentDidUpdate.md)
9899
- [isComponentName](functions/isComponentName.md)
99100
- [isComponentNameLoose](functions/isComponentNameLoose.md)
101+
- [isComponentWillMount](functions/isComponentWillMount.md)
102+
- [isComponentWillReceiveProps](functions/isComponentWillReceiveProps.md)
100103
- [isComponentWillUnmount](functions/isComponentWillUnmount.md)
104+
- [isComponentWillUpdate](functions/isComponentWillUpdate.md)
101105
- [isComponentWrapperCall](functions/isComponentWrapperCall.md)
102106
- [isComponentWrapperCallLoose](functions/isComponentWrapperCallLoose.md)
103107
- [isDeclaredInRenderPropLoose](functions/isDeclaredInRenderPropLoose.md)
104108
- [isFunctionOfComponentDidMount](functions/isFunctionOfComponentDidMount.md)
105109
- [isFunctionOfComponentWillUnmount](functions/isFunctionOfComponentWillUnmount.md)
110+
- [isFunctionOfRender](functions/isFunctionOfRender.md)
106111
- [isFunctionOfRenderMethod](functions/isFunctionOfRenderMethod.md)
107112
- [isFunctionOfUseEffectCleanup](functions/isFunctionOfUseEffectCleanup.md)
108113
- [isFunctionOfUseEffectSetup](functions/isFunctionOfUseEffectSetup.md)
114+
- [isGetChildContext](functions/isGetChildContext.md)
115+
- [isGetDefaultProps](functions/isGetDefaultProps.md)
109116
- [isGetDerivedStateFromError](functions/isGetDerivedStateFromError.md)
110117
- [isGetDerivedStateFromProps](functions/isGetDerivedStateFromProps.md)
118+
- [isGetInitialState](functions/isGetInitialState.md)
119+
- [isGetSnapshotBeforeUpdate](functions/isGetSnapshotBeforeUpdate.md)
111120
- [isInitializedFromReact](functions/isInitializedFromReact.md)
112121
- [isInsideRenderMethod](functions/isInsideRenderMethod.md)
113122
- [isPureComponent](functions/isPureComponent.md)
@@ -121,9 +130,14 @@
121130
- [isReactHookName](functions/isReactHookName.md)
122131
- [isReactHookNameLoose](functions/isReactHookNameLoose.md)
123132
- [isRenderFunctionLoose](functions/isRenderFunctionLoose.md)
133+
- [isRenderLike](functions/isRenderLike.md)
124134
- [isRenderMethodLike](functions/isRenderMethodLike.md)
125135
- [isRenderPropLoose](functions/isRenderPropLoose.md)
136+
- [isShouldComponentUpdate](functions/isShouldComponentUpdate.md)
126137
- [isThisSetState](functions/isThisSetState.md)
138+
- [isUnsafeComponentWillMount](functions/isUnsafeComponentWillMount.md)
139+
- [isUnsafeComponentWillReceiveProps](functions/isUnsafeComponentWillReceiveProps.md)
140+
- [isUnsafeComponentWillUpdate](functions/isUnsafeComponentWillUpdate.md)
127141
- [isUseEffectCallLoose](functions/isUseEffectCallLoose.md)
128142
- [isValidComponentDefinition](functions/isValidComponentDefinition.md)
129143
- [useComponentCollector](functions/useComponentCollector.md)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@eslint-react/core**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/core](../README.md) / isComponentDidUpdate
6+
7+
# Function: isComponentDidUpdate()
8+
9+
> **isComponentDidUpdate**(`node`): `node is TSESTreeMethodOrProperty`
10+
11+
## Parameters
12+
13+
### node
14+
15+
`Node`
16+
17+
## Returns
18+
19+
`node is TSESTreeMethodOrProperty`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@eslint-react/core**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/core](../README.md) / isComponentWillMount
6+
7+
# Function: isComponentWillMount()
8+
9+
> **isComponentWillMount**(`node`): `node is TSESTreeMethodOrProperty`
10+
11+
## Parameters
12+
13+
### node
14+
15+
`Node`
16+
17+
## Returns
18+
19+
`node is TSESTreeMethodOrProperty`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@eslint-react/core**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/core](../README.md) / isComponentWillReceiveProps
6+
7+
# Function: isComponentWillReceiveProps()
8+
9+
> **isComponentWillReceiveProps**(`node`): `node is TSESTreeMethodOrProperty`
10+
11+
## Parameters
12+
13+
### node
14+
15+
`Node`
16+
17+
## Returns
18+
19+
`node is TSESTreeMethodOrProperty`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@eslint-react/core**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/core](../README.md) / isComponentWillUpdate
6+
7+
# Function: isComponentWillUpdate()
8+
9+
> **isComponentWillUpdate**(`node`): `node is TSESTreeMethodOrProperty`
10+
11+
## Parameters
12+
13+
### node
14+
15+
`Node`
16+
17+
## Returns
18+
19+
`node is TSESTreeMethodOrProperty`
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[**@eslint-react/core**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/core](../README.md) / isFunctionOfRender
6+
7+
# Function: isFunctionOfRender()
8+
9+
> **isFunctionOfRender**(`node`): `boolean`
10+
11+
Check whether given node is a function of a render function of a class component
12+
13+
## Parameters
14+
15+
### node
16+
17+
`TSESTreeFunction`
18+
19+
The AST node to check
20+
21+
## Returns
22+
23+
`boolean`
24+
25+
`true` if node is a render function, `false` if not
26+
27+
## Example
28+
29+
```tsx
30+
class Component extends React.Component {
31+
render = () => <div />;
32+
```

packages/core/docs/functions/isFunctionOfRenderMethod.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,27 @@
88

99
> **isFunctionOfRenderMethod**(`node`): `boolean`
1010
11+
Check whether given node is a function of a render method of a class component
12+
1113
## Parameters
1214

1315
### node
1416

1517
`TSESTreeFunction`
1618

19+
The AST node to check
20+
1721
## Returns
1822

1923
`boolean`
24+
25+
`true` if node is a render function, `false` if not
26+
27+
## Example
28+
29+
```tsx
30+
class Component extends React.Component {
31+
renderHeader = () => <div />;
32+
renderFooter = () => <div />;
33+
}
34+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@eslint-react/core**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/core](../README.md) / isGetChildContext
6+
7+
# Function: isGetChildContext()
8+
9+
> **isGetChildContext**(`node`): `node is TSESTreeMethodOrProperty`
10+
11+
## Parameters
12+
13+
### node
14+
15+
`Node`
16+
17+
## Returns
18+
19+
`node is TSESTreeMethodOrProperty`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@eslint-react/core**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/core](../README.md) / isGetDefaultProps
6+
7+
# Function: isGetDefaultProps()
8+
9+
> **isGetDefaultProps**(`node`): `node is TSESTreeMethodOrProperty`
10+
11+
## Parameters
12+
13+
### node
14+
15+
`Node`
16+
17+
## Returns
18+
19+
`node is TSESTreeMethodOrProperty`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@eslint-react/core**](../README.md)
2+
3+
***
4+
5+
[@eslint-react/core](../README.md) / isGetInitialState
6+
7+
# Function: isGetInitialState()
8+
9+
> **isGetInitialState**(`node`): `node is TSESTreeMethodOrProperty`
10+
11+
## Parameters
12+
13+
### node
14+
15+
`Node`
16+
17+
## Returns
18+
19+
`node is TSESTreeMethodOrProperty`

0 commit comments

Comments
 (0)