eslint-plugin-react-x 4.0.2-beta.3 → 4.0.2-beta.4
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 +6 -6
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -147,7 +147,7 @@ const rules$7 = {
|
|
|
147
147
|
//#endregion
|
|
148
148
|
//#region package.json
|
|
149
149
|
var name$6 = "eslint-plugin-react-x";
|
|
150
|
-
var version = "4.0.2-beta.
|
|
150
|
+
var version = "4.0.2-beta.4";
|
|
151
151
|
|
|
152
152
|
//#endregion
|
|
153
153
|
//#region src/utils/create-rule.ts
|
|
@@ -1691,11 +1691,11 @@ function create$53(context) {
|
|
|
1691
1691
|
const setStateStack = [];
|
|
1692
1692
|
return defineRuleListener({
|
|
1693
1693
|
CallExpression(node) {
|
|
1694
|
-
if (!core.
|
|
1694
|
+
if (!core.isThisSetStateCall(node)) return;
|
|
1695
1695
|
setStateStack.push([node, false]);
|
|
1696
1696
|
},
|
|
1697
1697
|
"CallExpression:exit"(node) {
|
|
1698
|
-
if (!core.
|
|
1698
|
+
if (!core.isThisSetStateCall(node)) return;
|
|
1699
1699
|
setStateStack.pop();
|
|
1700
1700
|
},
|
|
1701
1701
|
ClassDeclaration(node) {
|
|
@@ -3037,7 +3037,7 @@ var no_set_state_in_component_did_mount_default = createRule({
|
|
|
3037
3037
|
function create$25(context) {
|
|
3038
3038
|
if (!context.sourceCode.text.includes("componentDidMount")) return {};
|
|
3039
3039
|
return defineRuleListener({ CallExpression(node) {
|
|
3040
|
-
if (!core.
|
|
3040
|
+
if (!core.isThisSetStateCall(node)) return;
|
|
3041
3041
|
const enclosingClassNode = ast.findParent(node, core.isClassComponent);
|
|
3042
3042
|
const enclosingMethodNode = ast.findParent(node, (n) => n === enclosingClassNode || core.isComponentDidMount(n));
|
|
3043
3043
|
if (enclosingClassNode == null || enclosingMethodNode == null || enclosingMethodNode === enclosingClassNode) return;
|
|
@@ -3067,7 +3067,7 @@ var no_set_state_in_component_did_update_default = createRule({
|
|
|
3067
3067
|
function create$24(context) {
|
|
3068
3068
|
if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
|
|
3069
3069
|
return defineRuleListener({ CallExpression(node) {
|
|
3070
|
-
if (!core.
|
|
3070
|
+
if (!core.isThisSetStateCall(node)) return;
|
|
3071
3071
|
const enclosingClassNode = ast.findParent(node, core.isClassComponent);
|
|
3072
3072
|
const enclosingMethodNode = ast.findParent(node, (n) => n === enclosingClassNode || core.isComponentDidUpdate(n));
|
|
3073
3073
|
if (enclosingClassNode == null || enclosingMethodNode == null || enclosingMethodNode === enclosingClassNode) return;
|
|
@@ -3097,7 +3097,7 @@ var no_set_state_in_component_will_update_default = createRule({
|
|
|
3097
3097
|
function create$23(context) {
|
|
3098
3098
|
if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
|
|
3099
3099
|
return defineRuleListener({ CallExpression(node) {
|
|
3100
|
-
if (!core.
|
|
3100
|
+
if (!core.isThisSetStateCall(node)) return;
|
|
3101
3101
|
const enclosingClassNode = ast.findParent(node, core.isClassComponent);
|
|
3102
3102
|
const enclosingMethodNode = ast.findParent(node, (n) => n === enclosingClassNode || core.isComponentWillUpdate(n));
|
|
3103
3103
|
if (enclosingClassNode == null || enclosingMethodNode == null || enclosingMethodNode === enclosingClassNode) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "4.0.2-beta.
|
|
3
|
+
"version": "4.0.2-beta.4",
|
|
4
4
|
"description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"string-ts": "^2.3.1",
|
|
46
46
|
"ts-api-utils": "^2.5.0",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "4.0.2-beta.
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/shared": "4.0.2-beta.
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/var": "4.0.2-beta.
|
|
48
|
+
"@eslint-react/ast": "4.0.2-beta.4",
|
|
49
|
+
"@eslint-react/core": "4.0.2-beta.4",
|
|
50
|
+
"@eslint-react/shared": "4.0.2-beta.4",
|
|
51
|
+
"@eslint-react/jsx": "4.0.2-beta.4",
|
|
52
|
+
"@eslint-react/var": "4.0.2-beta.4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/react": "^19.2.14",
|