@eslint-react/core 5.20.8 → 5.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -7
- package/dist/index.js +1 -18
- package/package.json +16 -11
package/dist/index.d.ts
CHANGED
|
@@ -301,13 +301,6 @@ export declare function isRenderMethodCallback(node: TSESTreeFunction): boolean;
|
|
|
301
301
|
* @deprecated Class components are legacy. This function exists only to support legacy rules.
|
|
302
302
|
*/
|
|
303
303
|
export declare function isThisSetStateCall(node: TSESTree.CallExpression): boolean;
|
|
304
|
-
/**
|
|
305
|
-
* Check if the assignment expression assigns to `this.state`.
|
|
306
|
-
* @param node The assignment expression node to check.
|
|
307
|
-
* @returns `true` if the node assigns to `this.state`.
|
|
308
|
-
* @deprecated Class components are legacy. This function exists only to support legacy rules.
|
|
309
|
-
*/
|
|
310
|
-
export declare function isAssignmentToThisState(node: TSESTree.AssignmentExpression): boolean;
|
|
311
304
|
//#endregion
|
|
312
305
|
//#region src/class-component-collector.d.ts
|
|
313
306
|
/**
|
package/dist/index.js
CHANGED
|
@@ -285,23 +285,6 @@ function isThisSetStateCall(node) {
|
|
|
285
285
|
const callee = Extract.unwrap(node.callee);
|
|
286
286
|
return callee.type === AST_NODE_TYPES.MemberExpression && Extract.unwrap(callee.object).type === AST_NODE_TYPES.ThisExpression && Extract.getCalleeName(node) === "setState";
|
|
287
287
|
}
|
|
288
|
-
/**
|
|
289
|
-
* Check if the assignment expression assigns to `this.state`.
|
|
290
|
-
* @param node The assignment expression node to check.
|
|
291
|
-
* @returns `true` if the node assigns to `this.state`.
|
|
292
|
-
* @deprecated Class components are legacy. This function exists only to support legacy rules.
|
|
293
|
-
*/
|
|
294
|
-
function isAssignmentToThisState(node) {
|
|
295
|
-
const { left } = node;
|
|
296
|
-
let current = Extract.unwrap(left);
|
|
297
|
-
while (current.type === AST_NODE_TYPES.MemberExpression) {
|
|
298
|
-
const object = Extract.unwrap(current.object);
|
|
299
|
-
const property = current.property;
|
|
300
|
-
if (object.type === AST_NODE_TYPES.ThisExpression && Check.isIdentifier(property, "state")) return true;
|
|
301
|
-
current = object;
|
|
302
|
-
}
|
|
303
|
-
return false;
|
|
304
|
-
}
|
|
305
288
|
|
|
306
289
|
//#endregion
|
|
307
290
|
//#region src/class-component-collector.ts
|
|
@@ -1929,4 +1912,4 @@ function getTypeVariants(types) {
|
|
|
1929
1912
|
}
|
|
1930
1913
|
|
|
1931
1914
|
//#endregion
|
|
1932
|
-
export { DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, FunctionComponentDetectionHint, FunctionComponentFlag, JsxDetectionHint, REACT_BUILTIN_HOOK_NAMES, SEL_FUNCTION_DISPLAY_NAME_ASSIGNMENT, getClassComponentCollector, getClassId, getCreateElementChildrenArguments, getCreateElementProp, getCreateElementPropsObject, getCreateElementTypeArgument, getFullyQualifiedNameEx, getFunctionComponentCollector, getFunctionComponentFlagFromInitPath, getFunctionComponentId, getFunctionDirectives, getFunctionId, getFunctionInitPath, getHookCollector, getJsxConfig, getJsxConfigFromAnnotation, getJsxConfigFromCompilerOptions, getTypeVariants, isAPI, isAPICall, isAnyType,
|
|
1915
|
+
export { DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, FunctionComponentDetectionHint, FunctionComponentFlag, JsxDetectionHint, REACT_BUILTIN_HOOK_NAMES, SEL_FUNCTION_DISPLAY_NAME_ASSIGNMENT, getClassComponentCollector, getClassId, getCreateElementChildrenArguments, getCreateElementProp, getCreateElementPropsObject, getCreateElementTypeArgument, getFullyQualifiedNameEx, getFunctionComponentCollector, getFunctionComponentFlagFromInitPath, getFunctionComponentId, getFunctionDirectives, getFunctionId, getFunctionInitPath, getHookCollector, getJsxConfig, getJsxConfigFromAnnotation, getJsxConfigFromCompilerOptions, getTypeVariants, isAPI, isAPICall, isAnyType, isBigIntType, isBooleanLiteralType, isBooleanType, isCaptureOwnerStack, isCaptureOwnerStackCall, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDidCatch, isComponentDidMount, isComponentDidUpdate, isComponentWillMount, isComponentWillReceiveProps, isComponentWillUnmount, isComponentWillUpdate, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateElementChildrenArgument, isCreateRef, isCreateRefCall, isEnumType, isFalseLiteralType, isFalsyBigIntType, isFalsyNumberType, isFalsyStringType, isForwardRef, isForwardRefCall, isFunctionComponentDefinition, isFunctionComponentName, isFunctionComponentNameLoose, isFunctionComponentWrapperCall, isFunctionComponentWrapperCallback, isFunctionEmpty, isFunctionHasCallInInitPath, isFunctionHasDirective, isFunctionWithLooseComponentName, isGetChildContext, isGetDefaultProps, isGetDerivedStateFromError, isGetDerivedStateFromProps, isGetInitialState, isGetSnapshotBeforeUpdate, isHookCall, isHookDefinition, isHookId, isHookName, isHookTag, isInsideCreateElementProps, isJsxLike, isLazy, isLazyCall, isMemo, isMemoCall, isNeverType, isNullishType, isNumberType, isObjectType, isPureComponent, isRender, isRenderMethodCallback, isRenderMethodLike, isShouldComponentUpdate, isStringType, isThisSetStateCall, isTrueLiteralType, isTruthyBigIntType, isTruthyNumberType, isTruthyStringType, isUnknownType, isUnsafeComponentWillMount, isUnsafeComponentWillReceiveProps, isUnsafeComponentWillUpdate, isUse, isUseActionState, isUseActionStateCall, isUseCall, isUseCallback, isUseCallbackCall, isUseContext, isUseContextCall, isUseDebugValue, isUseDebugValueCall, isUseDeferredValue, isUseDeferredValueCall, isUseEffect, isUseEffectCall, isUseEffectCleanupCallback, isUseEffectLikeCall, isUseEffectSetupCallback, isUseFormStatus, isUseFormStatusCall, isUseId, isUseIdCall, isUseImperativeHandle, isUseImperativeHandleCall, isUseInsertionEffect, isUseInsertionEffectCall, isUseLayoutEffect, isUseLayoutEffectCall, isUseMemo, isUseMemoCall, isUseOptimistic, isUseOptimisticCall, isUseReducer, isUseReducerCall, isUseRef, isUseRefCall, isUseRefLikeCall, isUseState, isUseStateCall, isUseStateLikeCall, isUseSyncExternalStore, isUseSyncExternalStoreCall, isUseTransition, isUseTransitionCall };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.21.0",
|
|
4
4
|
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -29,30 +29,35 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint-react/ast": "5.
|
|
33
|
-
"@eslint-react/eslint": "5.
|
|
34
|
-
"@eslint-react/shared": "5.
|
|
35
|
-
"@eslint-react/var": "5.
|
|
36
|
-
"@typescript-eslint/scope-manager": "^8.70.
|
|
37
|
-
"@typescript-eslint/types": "^8.70.
|
|
38
|
-
"@typescript-eslint/utils": "^8.70.
|
|
32
|
+
"@eslint-react/ast": "5.21.0",
|
|
33
|
+
"@eslint-react/eslint": "5.21.0",
|
|
34
|
+
"@eslint-react/shared": "5.21.0",
|
|
35
|
+
"@eslint-react/var": "5.21.0",
|
|
36
|
+
"@typescript-eslint/scope-manager": "^8.70.1",
|
|
37
|
+
"@typescript-eslint/types": "^8.70.1",
|
|
38
|
+
"@typescript-eslint/utils": "^8.70.1",
|
|
39
39
|
"ts-pattern": "^5.9.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@local/configs": "0.0.0",
|
|
43
43
|
"@local/eff": "0.0.0",
|
|
44
44
|
"@local/testkit": "0.0.0",
|
|
45
|
-
"@typescript-eslint/parser": "^8.70.
|
|
46
|
-
"@typescript-eslint/typescript-estree": "^8.70.
|
|
45
|
+
"@typescript-eslint/parser": "^8.70.1",
|
|
46
|
+
"@typescript-eslint/typescript-estree": "^8.70.1",
|
|
47
47
|
"eslint": "^10.11.0",
|
|
48
48
|
"tsdown": "^0.23.0",
|
|
49
49
|
"typescript": "6.0.3",
|
|
50
|
-
"vitest": "^5.0.
|
|
50
|
+
"vitest": "^5.0.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"eslint": "*",
|
|
54
54
|
"typescript": "*"
|
|
55
55
|
},
|
|
56
|
+
"peerDependenciesMeta": {
|
|
57
|
+
"eslint": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
56
61
|
"engines": {
|
|
57
62
|
"node": ">=22.0.0"
|
|
58
63
|
},
|