@eslint-react/core 2.2.4-next.3 → 2.2.4-next.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.d.ts +3 -3
- package/dist/index.js +16 -16
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -487,7 +487,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: AST.T
|
|
|
487
487
|
readonly toStatic: () => string | number | bigint | boolean | RegExp | null;
|
|
488
488
|
} | {
|
|
489
489
|
readonly kind: "expression";
|
|
490
|
-
readonly node: TSESTree.
|
|
490
|
+
readonly node: TSESTree.JSXEmptyExpression | TSESTree.Expression;
|
|
491
491
|
readonly toStatic: () => unknown;
|
|
492
492
|
} | {
|
|
493
493
|
readonly kind: "element";
|
|
@@ -495,7 +495,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: AST.T
|
|
|
495
495
|
readonly toStatic: () => undefined;
|
|
496
496
|
} | {
|
|
497
497
|
readonly kind: "spreadChild";
|
|
498
|
-
readonly node: TSESTree.
|
|
498
|
+
readonly node: TSESTree.JSXEmptyExpression | TSESTree.Expression;
|
|
499
499
|
readonly toStatic: () => undefined;
|
|
500
500
|
} | {
|
|
501
501
|
readonly kind: "spreadProps";
|
|
@@ -646,7 +646,7 @@ declare function stringifyJsx(node: TSESTree$1.JSXIdentifier | TSESTree$1.JSXNam
|
|
|
646
646
|
* @param prev The previous AST node in the traversal (used for context)
|
|
647
647
|
* @internal
|
|
648
648
|
*/
|
|
649
|
-
declare function getInstanceId(node: TSESTree.Node, prev?: TSESTree.Node): TSESTree.
|
|
649
|
+
declare function getInstanceId(node: TSESTree.Node, prev?: TSESTree.Node): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldExpression | undefined;
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region src/utils/is-from-react.d.ts
|
|
652
652
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1048,26 +1048,26 @@ function useComponentCollectorLegacy() {
|
|
|
1048
1048
|
* @param methodName The lifecycle method name
|
|
1049
1049
|
* @param isStatic Whether the method is static
|
|
1050
1050
|
*/
|
|
1051
|
-
function createLifecycleChecker(methodName, isStatic) {
|
|
1051
|
+
function createLifecycleChecker(methodName, isStatic = false) {
|
|
1052
1052
|
return function(node) {
|
|
1053
1053
|
return AST.isMethodOrProperty(node) && node.static === isStatic && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === methodName;
|
|
1054
1054
|
};
|
|
1055
1055
|
}
|
|
1056
|
-
const isRender = createLifecycleChecker("render"
|
|
1057
|
-
const isComponentDidCatch = createLifecycleChecker("componentDidCatch"
|
|
1058
|
-
const isComponentDidMount = createLifecycleChecker("componentDidMount"
|
|
1059
|
-
const isComponentDidUpdate = createLifecycleChecker("componentDidUpdate"
|
|
1060
|
-
const isComponentWillMount = createLifecycleChecker("componentWillMount"
|
|
1061
|
-
const isComponentWillReceiveProps = createLifecycleChecker("componentWillReceiveProps"
|
|
1062
|
-
const isComponentWillUnmount = createLifecycleChecker("componentWillUnmount"
|
|
1063
|
-
const isComponentWillUpdate = createLifecycleChecker("componentWillUpdate"
|
|
1064
|
-
const isGetChildContext = createLifecycleChecker("getChildContext"
|
|
1065
|
-
const isGetInitialState = createLifecycleChecker("getInitialState"
|
|
1066
|
-
const isGetSnapshotBeforeUpdate = createLifecycleChecker("getSnapshotBeforeUpdate"
|
|
1067
|
-
const isShouldComponentUpdate = createLifecycleChecker("shouldComponentUpdate"
|
|
1068
|
-
const isUnsafeComponentWillMount = createLifecycleChecker("UNSAFE_componentWillMount"
|
|
1069
|
-
const isUnsafeComponentWillReceiveProps = createLifecycleChecker("UNSAFE_componentWillReceiveProps"
|
|
1070
|
-
const isUnsafeComponentWillUpdate = createLifecycleChecker("UNSAFE_componentWillUpdate"
|
|
1056
|
+
const isRender = createLifecycleChecker("render");
|
|
1057
|
+
const isComponentDidCatch = createLifecycleChecker("componentDidCatch");
|
|
1058
|
+
const isComponentDidMount = createLifecycleChecker("componentDidMount");
|
|
1059
|
+
const isComponentDidUpdate = createLifecycleChecker("componentDidUpdate");
|
|
1060
|
+
const isComponentWillMount = createLifecycleChecker("componentWillMount");
|
|
1061
|
+
const isComponentWillReceiveProps = createLifecycleChecker("componentWillReceiveProps");
|
|
1062
|
+
const isComponentWillUnmount = createLifecycleChecker("componentWillUnmount");
|
|
1063
|
+
const isComponentWillUpdate = createLifecycleChecker("componentWillUpdate");
|
|
1064
|
+
const isGetChildContext = createLifecycleChecker("getChildContext");
|
|
1065
|
+
const isGetInitialState = createLifecycleChecker("getInitialState");
|
|
1066
|
+
const isGetSnapshotBeforeUpdate = createLifecycleChecker("getSnapshotBeforeUpdate");
|
|
1067
|
+
const isShouldComponentUpdate = createLifecycleChecker("shouldComponentUpdate");
|
|
1068
|
+
const isUnsafeComponentWillMount = createLifecycleChecker("UNSAFE_componentWillMount");
|
|
1069
|
+
const isUnsafeComponentWillReceiveProps = createLifecycleChecker("UNSAFE_componentWillReceiveProps");
|
|
1070
|
+
const isUnsafeComponentWillUpdate = createLifecycleChecker("UNSAFE_componentWillUpdate");
|
|
1071
1071
|
const isGetDefaultProps = createLifecycleChecker("getDefaultProps", true);
|
|
1072
1072
|
const isGetDerivedStateFromProps = createLifecycleChecker("getDerivedStateFromProps", true);
|
|
1073
1073
|
const isGetDerivedStateFromError = createLifecycleChecker("getDerivedStateFromError", true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "2.2.4-next.
|
|
3
|
+
"version": "2.2.4-next.4",
|
|
4
4
|
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@typescript-eslint/utils": "^8.46.2",
|
|
36
36
|
"birecord": "^0.1.1",
|
|
37
37
|
"ts-pattern": "^5.8.0",
|
|
38
|
-
"@eslint-react/ast": "2.2.4-next.
|
|
39
|
-
"@eslint-react/
|
|
40
|
-
"@eslint-react/
|
|
41
|
-
"@eslint-react/
|
|
38
|
+
"@eslint-react/ast": "2.2.4-next.4",
|
|
39
|
+
"@eslint-react/shared": "2.2.4-next.4",
|
|
40
|
+
"@eslint-react/var": "2.2.4-next.4",
|
|
41
|
+
"@eslint-react/eff": "2.2.4-next.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"tsdown": "^0.15.9",
|