eslint-plugin-react-hooks-extra 2.7.4 → 2.7.5-beta.11
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.js +4 -4
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WEBSITE_URL, getConfigAdapters, getSettingsFromContext } from "@eslint-react/shared";
|
|
2
2
|
import * as AST from "@eslint-react/ast";
|
|
3
|
-
import {
|
|
3
|
+
import { isHookName, isUseCallbackCall, isUseEffectLikeCall, isUseMemoCall, isUseStateLikeCall } from "@eslint-react/core";
|
|
4
4
|
import { constVoid, getOrElseUpdate, not } from "@eslint-react/eff";
|
|
5
5
|
import { findVariable, getVariableDefinitionNode } from "@eslint-react/var";
|
|
6
6
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
@@ -36,7 +36,7 @@ const rules = { "react-hooks-extra/no-direct-set-state-in-use-effect": "warn" };
|
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region package.json
|
|
38
38
|
var name = "eslint-plugin-react-hooks-extra";
|
|
39
|
-
var version = "2.7.
|
|
39
|
+
var version = "2.7.5-beta.11";
|
|
40
40
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/utils/create-rule.ts
|
|
@@ -50,8 +50,8 @@ const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
|
50
50
|
function isInitFromHookCall(init) {
|
|
51
51
|
if (init?.type !== AST_NODE_TYPES.CallExpression) return false;
|
|
52
52
|
switch (init.callee.type) {
|
|
53
|
-
case AST_NODE_TYPES.Identifier: return
|
|
54
|
-
case AST_NODE_TYPES.MemberExpression: return init.callee.property.type === AST_NODE_TYPES.Identifier &&
|
|
53
|
+
case AST_NODE_TYPES.Identifier: return isHookName(init.callee.name);
|
|
54
|
+
case AST_NODE_TYPES.MemberExpression: return init.callee.property.type === AST_NODE_TYPES.Identifier && isHookName(init.callee.property.name);
|
|
55
55
|
default: return false;
|
|
56
56
|
}
|
|
57
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks-extra",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.5-beta.11",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -39,20 +39,20 @@
|
|
|
39
39
|
"./package.json"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
43
|
-
"@typescript-eslint/type-utils": "^8.
|
|
44
|
-
"@typescript-eslint/types": "^8.
|
|
45
|
-
"@typescript-eslint/utils": "^8.
|
|
42
|
+
"@typescript-eslint/scope-manager": "^8.54.0",
|
|
43
|
+
"@typescript-eslint/type-utils": "^8.54.0",
|
|
44
|
+
"@typescript-eslint/types": "^8.54.0",
|
|
45
|
+
"@typescript-eslint/utils": "^8.54.0",
|
|
46
46
|
"string-ts": "^2.3.1",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "2.7.
|
|
49
|
-
"@eslint-react/core": "2.7.
|
|
50
|
-
"@eslint-react/eff": "2.7.
|
|
51
|
-
"@eslint-react/shared": "2.7.
|
|
52
|
-
"@eslint-react/var": "2.7.
|
|
48
|
+
"@eslint-react/ast": "2.7.5-beta.11",
|
|
49
|
+
"@eslint-react/core": "2.7.5-beta.11",
|
|
50
|
+
"@eslint-react/eff": "2.7.5-beta.11",
|
|
51
|
+
"@eslint-react/shared": "2.7.5-beta.11",
|
|
52
|
+
"@eslint-react/var": "2.7.5-beta.11"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/react": "^19.2.
|
|
55
|
+
"@types/react": "^19.2.10",
|
|
56
56
|
"@types/react-dom": "^19.2.3",
|
|
57
57
|
"tsdown": "^0.20.1",
|
|
58
58
|
"@local/configs": "0.0.0"
|