eslint-plugin-react-hooks-extra 1.52.3-next.9 → 1.52.4-beta.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 +2 -26
- package/dist/index.mjs +2 -26
- package/package.json +14 -15
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var rules = {
|
|
|
52
52
|
|
|
53
53
|
// package.json
|
|
54
54
|
var name2 = "eslint-plugin-react-hooks-extra";
|
|
55
|
-
var version = "1.52.
|
|
55
|
+
var version = "1.52.4-beta.0";
|
|
56
56
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("hooks-extra"));
|
|
57
57
|
function isFromHookCall(context, name3, settings, predicate = eff.constTrue) {
|
|
58
58
|
const hookAlias = settings.additionalHooks[name3] ?? [];
|
|
@@ -600,19 +600,9 @@ function create5(context) {
|
|
|
600
600
|
if (containsUseComments(context, node)) {
|
|
601
601
|
continue;
|
|
602
602
|
}
|
|
603
|
-
if (id != null) {
|
|
604
|
-
context.report({
|
|
605
|
-
messageId: "noUnnecessaryUsePrefix",
|
|
606
|
-
data: {
|
|
607
|
-
name: name3
|
|
608
|
-
},
|
|
609
|
-
loc: getPreferredLoc(context, id)
|
|
610
|
-
});
|
|
611
|
-
continue;
|
|
612
|
-
}
|
|
613
603
|
context.report({
|
|
614
604
|
messageId: "noUnnecessaryUsePrefix",
|
|
615
|
-
node,
|
|
605
|
+
node: id ?? node,
|
|
616
606
|
data: {
|
|
617
607
|
name: name3
|
|
618
608
|
}
|
|
@@ -621,20 +611,6 @@ function create5(context) {
|
|
|
621
611
|
}
|
|
622
612
|
};
|
|
623
613
|
}
|
|
624
|
-
function getPreferredLoc(context, id) {
|
|
625
|
-
if (AST__namespace.isMultiLine(id)) return id.loc;
|
|
626
|
-
if (!context.sourceCode.getText(id).startsWith("use")) return id.loc;
|
|
627
|
-
return {
|
|
628
|
-
end: {
|
|
629
|
-
column: id.loc.start.column + 3,
|
|
630
|
-
line: id.loc.start.line
|
|
631
|
-
},
|
|
632
|
-
start: {
|
|
633
|
-
column: id.loc.start.column,
|
|
634
|
-
line: id.loc.start.line
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
614
|
var RULE_NAME6 = "prefer-use-state-lazy-initialization";
|
|
639
615
|
var RULE_FEATURES6 = [
|
|
640
616
|
"EXP"
|
package/dist/index.mjs
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 = "1.52.
|
|
31
|
+
var version = "1.52.4-beta.0";
|
|
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] ?? [];
|
|
@@ -576,19 +576,9 @@ function create5(context) {
|
|
|
576
576
|
if (containsUseComments(context, node)) {
|
|
577
577
|
continue;
|
|
578
578
|
}
|
|
579
|
-
if (id != null) {
|
|
580
|
-
context.report({
|
|
581
|
-
messageId: "noUnnecessaryUsePrefix",
|
|
582
|
-
data: {
|
|
583
|
-
name: name3
|
|
584
|
-
},
|
|
585
|
-
loc: getPreferredLoc(context, id)
|
|
586
|
-
});
|
|
587
|
-
continue;
|
|
588
|
-
}
|
|
589
579
|
context.report({
|
|
590
580
|
messageId: "noUnnecessaryUsePrefix",
|
|
591
|
-
node,
|
|
581
|
+
node: id ?? node,
|
|
592
582
|
data: {
|
|
593
583
|
name: name3
|
|
594
584
|
}
|
|
@@ -597,20 +587,6 @@ function create5(context) {
|
|
|
597
587
|
}
|
|
598
588
|
};
|
|
599
589
|
}
|
|
600
|
-
function getPreferredLoc(context, id) {
|
|
601
|
-
if (AST.isMultiLine(id)) return id.loc;
|
|
602
|
-
if (!context.sourceCode.getText(id).startsWith("use")) return id.loc;
|
|
603
|
-
return {
|
|
604
|
-
end: {
|
|
605
|
-
column: id.loc.start.column + 3,
|
|
606
|
-
line: id.loc.start.line
|
|
607
|
-
},
|
|
608
|
-
start: {
|
|
609
|
-
column: id.loc.start.column,
|
|
610
|
-
line: id.loc.start.line
|
|
611
|
-
}
|
|
612
|
-
};
|
|
613
|
-
}
|
|
614
590
|
var RULE_NAME6 = "prefer-use-state-lazy-initialization";
|
|
615
591
|
var RULE_FEATURES6 = [
|
|
616
592
|
"EXP"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks-extra",
|
|
3
|
-
"version": "1.52.
|
|
3
|
+
"version": "1.52.4-beta.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -44,22 +44,22 @@
|
|
|
44
44
|
"./package.json"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
48
|
-
"@typescript-eslint/type-utils": "^8.
|
|
49
|
-
"@typescript-eslint/types": "^8.
|
|
50
|
-
"@typescript-eslint/utils": "^8.
|
|
47
|
+
"@typescript-eslint/scope-manager": "^8.38.0",
|
|
48
|
+
"@typescript-eslint/type-utils": "^8.38.0",
|
|
49
|
+
"@typescript-eslint/types": "^8.38.0",
|
|
50
|
+
"@typescript-eslint/utils": "^8.38.0",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
|
-
"ts-pattern": "^5.
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/eff": "1.52.
|
|
52
|
+
"ts-pattern": "^5.8.0",
|
|
53
|
+
"@eslint-react/kit": "1.52.4-beta.0",
|
|
54
|
+
"@eslint-react/core": "1.52.4-beta.0",
|
|
55
|
+
"@eslint-react/var": "1.52.4-beta.0",
|
|
56
|
+
"@eslint-react/ast": "1.52.4-beta.0",
|
|
57
|
+
"@eslint-react/shared": "1.52.4-beta.0",
|
|
58
|
+
"@eslint-react/eff": "1.52.4-beta.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/react": "^19.1.
|
|
62
|
-
"@types/react-dom": "^19.1.
|
|
61
|
+
"@types/react": "^19.1.9",
|
|
62
|
+
"@types/react-dom": "^19.1.7",
|
|
63
63
|
"tsup": "^8.5.0",
|
|
64
64
|
"@local/configs": "0.0.0"
|
|
65
65
|
},
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
|
-
"bun": ">=1.0.15",
|
|
80
79
|
"node": ">=18.18.0"
|
|
81
80
|
},
|
|
82
81
|
"publishConfig": {
|