eslint-plugin-react-hooks-extra 1.36.3-beta.1 → 1.36.3-next.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.js +4 -11
- package/dist/index.mjs +4 -11
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -50,7 +50,7 @@ var rules = {
|
|
|
50
50
|
|
|
51
51
|
// package.json
|
|
52
52
|
var name2 = "eslint-plugin-react-hooks-extra";
|
|
53
|
-
var version = "1.36.3-
|
|
53
|
+
var version = "1.36.3-next.0";
|
|
54
54
|
var createRule = shared.createRuleForPlugin("hooks-extra");
|
|
55
55
|
function isFromHookCall(context, name3, settings, predicate = eff.constTrue) {
|
|
56
56
|
const hookAlias = settings.additionalHooks[name3] ?? [];
|
|
@@ -576,14 +576,7 @@ function create5(context) {
|
|
|
576
576
|
}
|
|
577
577
|
var RULE_NAME6 = "prefer-use-state-lazy-initialization";
|
|
578
578
|
var RULE_FEATURES6 = [];
|
|
579
|
-
var ALLOW_LIST = [
|
|
580
|
-
"Boolean",
|
|
581
|
-
"String",
|
|
582
|
-
"Number"
|
|
583
|
-
];
|
|
584
|
-
function isAllowedName(name3) {
|
|
585
|
-
return ALLOW_LIST.includes(name3) || core.isReactHookName(name3);
|
|
586
|
-
}
|
|
579
|
+
var ALLOW_LIST = ["Boolean", "String", "Number"];
|
|
587
580
|
var prefer_use_state_lazy_initialization_default = createRule({
|
|
588
581
|
meta: {
|
|
589
582
|
type: "problem",
|
|
@@ -617,10 +610,10 @@ function create6(context) {
|
|
|
617
610
|
}
|
|
618
611
|
const nestedCallExpressions = AST__namespace.getNestedCallExpressions(useStateInput);
|
|
619
612
|
const hasFunctionCall = nestedCallExpressions.some((n) => {
|
|
620
|
-
return "name" in n.callee && !
|
|
613
|
+
return "name" in n.callee && !ALLOW_LIST.includes(n.callee.name);
|
|
621
614
|
});
|
|
622
615
|
const hasNewCall = AST__namespace.getNestedNewExpressions(useStateInput).some((n) => {
|
|
623
|
-
return "name" in n.callee && !
|
|
616
|
+
return "name" in n.callee && !ALLOW_LIST.includes(n.callee.name);
|
|
624
617
|
});
|
|
625
618
|
if (!hasFunctionCall && !hasNewCall) {
|
|
626
619
|
return;
|
package/dist/index.mjs
CHANGED
|
@@ -27,7 +27,7 @@ var rules = {
|
|
|
27
27
|
|
|
28
28
|
// package.json
|
|
29
29
|
var name2 = "eslint-plugin-react-hooks-extra";
|
|
30
|
-
var version = "1.36.3-
|
|
30
|
+
var version = "1.36.3-next.0";
|
|
31
31
|
var createRule = createRuleForPlugin("hooks-extra");
|
|
32
32
|
function isFromHookCall(context, name3, settings, predicate = constTrue) {
|
|
33
33
|
const hookAlias = settings.additionalHooks[name3] ?? [];
|
|
@@ -553,14 +553,7 @@ function create5(context) {
|
|
|
553
553
|
}
|
|
554
554
|
var RULE_NAME6 = "prefer-use-state-lazy-initialization";
|
|
555
555
|
var RULE_FEATURES6 = [];
|
|
556
|
-
var ALLOW_LIST = [
|
|
557
|
-
"Boolean",
|
|
558
|
-
"String",
|
|
559
|
-
"Number"
|
|
560
|
-
];
|
|
561
|
-
function isAllowedName(name3) {
|
|
562
|
-
return ALLOW_LIST.includes(name3) || isReactHookName(name3);
|
|
563
|
-
}
|
|
556
|
+
var ALLOW_LIST = ["Boolean", "String", "Number"];
|
|
564
557
|
var prefer_use_state_lazy_initialization_default = createRule({
|
|
565
558
|
meta: {
|
|
566
559
|
type: "problem",
|
|
@@ -594,10 +587,10 @@ function create6(context) {
|
|
|
594
587
|
}
|
|
595
588
|
const nestedCallExpressions = AST.getNestedCallExpressions(useStateInput);
|
|
596
589
|
const hasFunctionCall = nestedCallExpressions.some((n) => {
|
|
597
|
-
return "name" in n.callee && !
|
|
590
|
+
return "name" in n.callee && !ALLOW_LIST.includes(n.callee.name);
|
|
598
591
|
});
|
|
599
592
|
const hasNewCall = AST.getNestedNewExpressions(useStateInput).some((n) => {
|
|
600
|
-
return "name" in n.callee && !
|
|
593
|
+
return "name" in n.callee && !ALLOW_LIST.includes(n.callee.name);
|
|
601
594
|
});
|
|
602
595
|
if (!hasFunctionCall && !hasNewCall) {
|
|
603
596
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks-extra",
|
|
3
|
-
"version": "1.36.3-
|
|
3
|
+
"version": "1.36.3-next.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"@typescript-eslint/utils": "^8.26.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
52
|
"ts-pattern": "^5.6.2",
|
|
53
|
-
"@eslint-react/ast": "1.36.3-
|
|
54
|
-
"@eslint-react/core": "1.36.3-
|
|
55
|
-
"@eslint-react/eff": "1.36.3-
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
53
|
+
"@eslint-react/ast": "1.36.3-next.0",
|
|
54
|
+
"@eslint-react/core": "1.36.3-next.0",
|
|
55
|
+
"@eslint-react/eff": "1.36.3-next.0",
|
|
56
|
+
"@eslint-react/shared": "1.36.3-next.0",
|
|
57
|
+
"@eslint-react/var": "1.36.3-next.0",
|
|
58
|
+
"@eslint-react/jsx": "1.36.3-next.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.12",
|