eslint-plugin-react-hooks-extra 2.0.0-next.2 → 2.0.0-next.27
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 +15 -3
- package/package.json +18 -18
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var rules = {
|
|
|
28
28
|
|
|
29
29
|
// package.json
|
|
30
30
|
var name2 = "eslint-plugin-react-hooks-extra";
|
|
31
|
-
var version = "2.0.0-next.
|
|
31
|
+
var version = "2.0.0-next.27";
|
|
32
32
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("hooks-extra"));
|
|
33
33
|
function isFromHookCall(context, name3, settings, predicate = constTrue) {
|
|
34
34
|
const hookAlias = settings.additionalHooks[name3] ?? [];
|
|
@@ -163,9 +163,9 @@ function useNoDirectSetStateInUseEffect(context, options) {
|
|
|
163
163
|
}
|
|
164
164
|
function getCallName(node) {
|
|
165
165
|
if (node.type === AST_NODE_TYPES.CallExpression) {
|
|
166
|
-
return AST.
|
|
166
|
+
return AST.toStringFormat(node.callee, getText);
|
|
167
167
|
}
|
|
168
|
-
return AST.
|
|
168
|
+
return AST.toStringFormat(node, getText);
|
|
169
169
|
}
|
|
170
170
|
function getCallKind(node) {
|
|
171
171
|
return match(node).when(isUseStateCall, () => "useState").when(isUseEffectLikeCall, () => useEffectKind).when(isSetStateCall, () => "setState").when(isThenCall, () => "then").otherwise(() => "other");
|
|
@@ -306,6 +306,7 @@ var RULE_FEATURES = [
|
|
|
306
306
|
var no_direct_set_state_in_use_effect_default = createRule({
|
|
307
307
|
meta: {
|
|
308
308
|
type: "problem",
|
|
309
|
+
deprecated: true,
|
|
309
310
|
docs: {
|
|
310
311
|
description: "Disallow direct calls to the `set` function of `useState` in `useEffect`.",
|
|
311
312
|
[Symbol.for("rule_features")]: RULE_FEATURES
|
|
@@ -337,6 +338,7 @@ var RULE_FEATURES2 = [
|
|
|
337
338
|
var no_direct_set_state_in_use_layout_effect_default = createRule({
|
|
338
339
|
meta: {
|
|
339
340
|
type: "problem",
|
|
341
|
+
deprecated: true,
|
|
340
342
|
docs: {
|
|
341
343
|
description: "Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`.",
|
|
342
344
|
[Symbol.for("rule_features")]: RULE_FEATURES2
|
|
@@ -366,6 +368,7 @@ var RULE_FEATURES3 = [
|
|
|
366
368
|
var no_unnecessary_use_callback_default = createRule({
|
|
367
369
|
meta: {
|
|
368
370
|
type: "problem",
|
|
371
|
+
deprecated: true,
|
|
369
372
|
docs: {
|
|
370
373
|
description: "Disallow unnecessary usage of `useCallback`.",
|
|
371
374
|
[Symbol.for("rule_features")]: RULE_FEATURES3
|
|
@@ -445,6 +448,7 @@ var RULE_FEATURES4 = [
|
|
|
445
448
|
var no_unnecessary_use_memo_default = createRule({
|
|
446
449
|
meta: {
|
|
447
450
|
type: "problem",
|
|
451
|
+
deprecated: true,
|
|
448
452
|
docs: {
|
|
449
453
|
description: "Disallow unnecessary usage of `useMemo`.",
|
|
450
454
|
[Symbol.for("rule_features")]: RULE_FEATURES4
|
|
@@ -532,6 +536,7 @@ function containsUseComments(context, node) {
|
|
|
532
536
|
var no_unnecessary_use_prefix_default = createRule({
|
|
533
537
|
meta: {
|
|
534
538
|
type: "problem",
|
|
539
|
+
deprecated: true,
|
|
535
540
|
docs: {
|
|
536
541
|
description: "Enforces that a function with the `use` prefix should use at least one Hook inside of it.",
|
|
537
542
|
[Symbol.for("rule_features")]: RULE_FEATURES5
|
|
@@ -611,6 +616,7 @@ var ALLOW_LIST = [
|
|
|
611
616
|
var prefer_use_state_lazy_initialization_default = createRule({
|
|
612
617
|
meta: {
|
|
613
618
|
type: "problem",
|
|
619
|
+
deprecated: true,
|
|
614
620
|
docs: {
|
|
615
621
|
description: "Enforces function calls made inside `useState` to be wrapped in an `initializer function`.",
|
|
616
622
|
[Symbol.for("rule_features")]: RULE_FEATURES6
|
|
@@ -669,11 +675,17 @@ var plugin = {
|
|
|
669
675
|
version
|
|
670
676
|
},
|
|
671
677
|
rules: {
|
|
678
|
+
/** @deprecated Use `react-x/no-direct-set-state-in-use-effect` instead */
|
|
672
679
|
"no-direct-set-state-in-use-effect": no_direct_set_state_in_use_effect_default,
|
|
680
|
+
/** @deprecated Use `react-x/no-direct-set-state-in-use-layout-effect` instead */
|
|
673
681
|
"no-direct-set-state-in-use-layout-effect": no_direct_set_state_in_use_layout_effect_default,
|
|
682
|
+
/** @deprecated Use `react-x/no-unnecessary-use-callback` instead */
|
|
674
683
|
"no-unnecessary-use-callback": no_unnecessary_use_callback_default,
|
|
684
|
+
/** @deprecated Use `react-x/no-unnecessary-use-memo` instead */
|
|
675
685
|
"no-unnecessary-use-memo": no_unnecessary_use_memo_default,
|
|
686
|
+
/** @deprecated Use `react-x/no-unnecessary-use-prefix` instead */
|
|
676
687
|
"no-unnecessary-use-prefix": no_unnecessary_use_prefix_default,
|
|
688
|
+
/** @deprecated Use `react-x/prefer-use-state-lazy-initialization` instead */
|
|
677
689
|
"prefer-use-state-lazy-initialization": prefer_use_state_lazy_initialization_default
|
|
678
690
|
}
|
|
679
691
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks-extra",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.27",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
"./package.json"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
40
|
-
"@typescript-eslint/type-utils": "^8.
|
|
41
|
-
"@typescript-eslint/types": "^8.
|
|
42
|
-
"@typescript-eslint/utils": "^8.
|
|
39
|
+
"@typescript-eslint/scope-manager": "^8.33.0",
|
|
40
|
+
"@typescript-eslint/type-utils": "^8.33.0",
|
|
41
|
+
"@typescript-eslint/types": "^8.33.0",
|
|
42
|
+
"@typescript-eslint/utils": "^8.33.0",
|
|
43
43
|
"string-ts": "^2.2.1",
|
|
44
|
-
"ts-pattern": "^5.7.
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
44
|
+
"ts-pattern": "^5.7.1",
|
|
45
|
+
"@eslint-react/ast": "2.0.0-next.27",
|
|
46
|
+
"@eslint-react/core": "2.0.0-next.27",
|
|
47
|
+
"@eslint-react/kit": "2.0.0-next.27",
|
|
48
|
+
"@eslint-react/shared": "2.0.0-next.27",
|
|
49
|
+
"@eslint-react/var": "2.0.0-next.27",
|
|
50
|
+
"@eslint-react/eff": "2.0.0-next.27"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@types/react": "^19.1.
|
|
54
|
-
"@types/react-dom": "^19.1.
|
|
55
|
-
"tsup": "^8.
|
|
53
|
+
"@types/react": "^19.1.6",
|
|
54
|
+
"@types/react-dom": "^19.1.5",
|
|
55
|
+
"tsup": "^8.5.0",
|
|
56
56
|
"@local/configs": "0.0.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"eslint": "^9.
|
|
60
|
-
"typescript": "^4.9.5 || ^5.
|
|
59
|
+
"eslint": "^8.57.0 || ^9.0.0",
|
|
60
|
+
"typescript": "^4.9.5 || ^5.3.3"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"eslint": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
71
|
"bun": ">=1.0.15",
|
|
72
|
-
"node": ">=
|
|
72
|
+
"node": ">=18.18.0"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|