eslint-plugin-react-x 1.23.3-next.1 → 1.23.3-next.3
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 +7 -17
- package/dist/index.mjs +8 -18
- package/package.json +14 -10
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
|
42
42
|
|
|
43
43
|
// package.json
|
|
44
44
|
var name = "eslint-plugin-react-x";
|
|
45
|
-
var version = "1.23.3-next.
|
|
45
|
+
var version = "1.23.3-next.3";
|
|
46
46
|
var createRule = shared.createRuleForPlugin("x");
|
|
47
47
|
|
|
48
48
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -650,22 +650,12 @@ var RULE_NAME12 = "no-class-component";
|
|
|
650
650
|
var RULE_FEATURES12 = [
|
|
651
651
|
"CHK"
|
|
652
652
|
];
|
|
653
|
-
|
|
654
|
-
key
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
static: false
|
|
660
|
-
});
|
|
661
|
-
var isGetDerivedStateFromError = tsPattern.isMatching({
|
|
662
|
-
key: {
|
|
663
|
-
type: types.AST_NODE_TYPES.Identifier,
|
|
664
|
-
name: "getDerivedStateFromError"
|
|
665
|
-
},
|
|
666
|
-
type: tsPattern.P.union(types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition),
|
|
667
|
-
static: true
|
|
668
|
-
});
|
|
653
|
+
function isComponentDidCatch(node) {
|
|
654
|
+
return (node.type === types.AST_NODE_TYPES.MethodDefinition || node.type === types.AST_NODE_TYPES.PropertyDefinition) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidCatch";
|
|
655
|
+
}
|
|
656
|
+
function isGetDerivedStateFromError(node) {
|
|
657
|
+
return (node.type === types.AST_NODE_TYPES.MethodDefinition || node.type === types.AST_NODE_TYPES.PropertyDefinition) && node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "getDerivedStateFromError";
|
|
658
|
+
}
|
|
669
659
|
var no_class_component_default = createRule({
|
|
670
660
|
meta: {
|
|
671
661
|
type: "problem",
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { createRuleForPlugin, getSettingsFromContext, unsafeDecodeSettings } fro
|
|
|
4
4
|
import * as AST11 from '@eslint-react/ast';
|
|
5
5
|
import { isForwardRefCall, isThisSetState, isClassComponent, isCreateElementCall, isCloneElementCall, isChildrenCount, isChildrenForEach, isChildrenMap, isChildrenOnly, isChildrenToArray, useComponentCollectorLegacy, isCreateRefCall, isComponentName, useComponentCollector, ERFunctionComponentFlag, isChildrenToArrayCall, ERComponentHint, isDirectValueOfRenderPropertyLoose, isDeclaredInRenderPropLoose, isInsideCreateElementProps, isInsideRenderMethod, ERClassComponentFlag, isReactHookCall, isInitializedFromReact } from '@eslint-react/core';
|
|
6
6
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
7
|
-
import { isMatching,
|
|
7
|
+
import { isMatching, match, P } from 'ts-pattern';
|
|
8
8
|
import { compare } from 'compare-versions';
|
|
9
9
|
import * as VAR from '@eslint-react/var';
|
|
10
10
|
import { getConstrainedTypeAtLocation, isTypeReadonly } from '@typescript-eslint/type-utils';
|
|
@@ -15,7 +15,7 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
|
|
|
15
15
|
|
|
16
16
|
// package.json
|
|
17
17
|
var name = "eslint-plugin-react-x";
|
|
18
|
-
var version = "1.23.3-next.
|
|
18
|
+
var version = "1.23.3-next.3";
|
|
19
19
|
var createRule = createRuleForPlugin("x");
|
|
20
20
|
|
|
21
21
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -623,22 +623,12 @@ var RULE_NAME12 = "no-class-component";
|
|
|
623
623
|
var RULE_FEATURES12 = [
|
|
624
624
|
"CHK"
|
|
625
625
|
];
|
|
626
|
-
|
|
627
|
-
key
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
static: false
|
|
633
|
-
});
|
|
634
|
-
var isGetDerivedStateFromError = isMatching({
|
|
635
|
-
key: {
|
|
636
|
-
type: AST_NODE_TYPES.Identifier,
|
|
637
|
-
name: "getDerivedStateFromError"
|
|
638
|
-
},
|
|
639
|
-
type: P.union(AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition),
|
|
640
|
-
static: true
|
|
641
|
-
});
|
|
626
|
+
function isComponentDidCatch(node) {
|
|
627
|
+
return (node.type === AST_NODE_TYPES.MethodDefinition || node.type === AST_NODE_TYPES.PropertyDefinition) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidCatch";
|
|
628
|
+
}
|
|
629
|
+
function isGetDerivedStateFromError(node) {
|
|
630
|
+
return (node.type === AST_NODE_TYPES.MethodDefinition || node.type === AST_NODE_TYPES.PropertyDefinition) && node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getDerivedStateFromError";
|
|
631
|
+
}
|
|
642
632
|
var no_class_component_default = createRule({
|
|
643
633
|
meta: {
|
|
644
634
|
type: "problem",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.23.3-next.
|
|
3
|
+
"version": "1.23.3-next.3",
|
|
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",
|
|
@@ -49,25 +49,26 @@
|
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
50
|
"is-immutable-type": "^5.0.1",
|
|
51
51
|
"string-ts": "^2.2.0",
|
|
52
|
-
"ts-api-utils": "^2.0.0",
|
|
53
52
|
"ts-pattern": "^5.6.0",
|
|
54
|
-
"@eslint-react/ast": "1.23.3-next.
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/jsx": "1.23.3-next.
|
|
58
|
-
"@eslint-react/
|
|
59
|
-
"@eslint-react/
|
|
60
|
-
"@eslint-react/
|
|
53
|
+
"@eslint-react/ast": "1.23.3-next.3",
|
|
54
|
+
"@eslint-react/eff": "1.23.3-next.3",
|
|
55
|
+
"@eslint-react/core": "1.23.3-next.3",
|
|
56
|
+
"@eslint-react/jsx": "1.23.3-next.3",
|
|
57
|
+
"@eslint-react/shared": "1.23.3-next.3",
|
|
58
|
+
"@eslint-react/types": "1.23.3-next.3",
|
|
59
|
+
"@eslint-react/var": "1.23.3-next.3"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@types/react": "^19.0.3",
|
|
64
63
|
"@types/react-dom": "^19.0.2",
|
|
65
64
|
"tsup": "^8.3.5",
|
|
65
|
+
"ts-api-utils": "^2.0.0",
|
|
66
66
|
"@workspace/configs": "0.0.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"eslint": "^8.57.0 || ^9.0.0",
|
|
70
|
-
"typescript": "^4.9.5 || ^5.3.3"
|
|
70
|
+
"typescript": "^4.9.5 || ^5.3.3",
|
|
71
|
+
"ts-api-utils": "^2.0.0"
|
|
71
72
|
},
|
|
72
73
|
"peerDependenciesMeta": {
|
|
73
74
|
"eslint": {
|
|
@@ -75,6 +76,9 @@
|
|
|
75
76
|
},
|
|
76
77
|
"typescript": {
|
|
77
78
|
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"ts-api-utils": {
|
|
81
|
+
"optional": true
|
|
78
82
|
}
|
|
79
83
|
},
|
|
80
84
|
"engines": {
|