@eslint-react/core 5.2.4-beta.3 → 5.2.4-beta.5
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 +4 -4
- package/dist/index.js +1 -3
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TSESTreeClass, TSESTreeDirective, TSESTreeFunction, TSESTreeMethodOrPropertyDefinition } from "@eslint-react/ast";
|
|
2
2
|
import { TSESTree } from "@typescript-eslint/types";
|
|
3
|
-
import { RuleContext } from "@eslint-react/eslint";
|
|
4
3
|
import { RegExpLike } from "@eslint-react/shared";
|
|
5
|
-
import { ESLintUtils, TSESTree as TSESTree$1 } from "@typescript-eslint/utils";
|
|
6
4
|
import ts from "typescript";
|
|
5
|
+
import { RuleContext } from "@eslint-react/eslint";
|
|
7
6
|
import { Scope } from "@typescript-eslint/scope-manager";
|
|
7
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
8
8
|
|
|
9
9
|
//#region src/api.d.ts
|
|
10
10
|
declare namespace isAPI {
|
|
@@ -315,7 +315,7 @@ type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSemanticN
|
|
|
315
315
|
* @param node - The function node to analyze.
|
|
316
316
|
* @returns The identifier node if found, `null` otherwise.
|
|
317
317
|
*/
|
|
318
|
-
declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): 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.
|
|
318
|
+
declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): 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.TemplateLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | 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 | TSESTree.PrivateIdentifier | null;
|
|
319
319
|
/**
|
|
320
320
|
* Identifies the initialization path of a function node in the AST.
|
|
321
321
|
*
|
|
@@ -602,7 +602,7 @@ declare function isUseEffectCleanupCallback(node: TSESTree.Node | null): boolean
|
|
|
602
602
|
declare namespace getHookCollector {
|
|
603
603
|
type ReturnType = {
|
|
604
604
|
api: {
|
|
605
|
-
getAllHooks(node: TSESTree
|
|
605
|
+
getAllHooks(node: TSESTree.Program): HookSemanticNode[];
|
|
606
606
|
};
|
|
607
607
|
visitor: ESLintUtils.RuleListener;
|
|
608
608
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Check, Extract, Traverse, is, isOneOf } from "@eslint-react/ast";
|
|
2
2
|
import { resolveImportSource } from "@eslint-react/var";
|
|
3
3
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
4
|
-
import "@eslint-react/eslint";
|
|
5
4
|
import { randomBytes } from "node:crypto";
|
|
6
5
|
import { JsxDetectionHint, isJsxLike } from "@eslint-react/jsx";
|
|
7
6
|
import { RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE } from "@eslint-react/shared";
|
|
8
|
-
import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from "@typescript-eslint/utils";
|
|
9
7
|
import { P, isMatching, match } from "ts-pattern";
|
|
10
8
|
import ts from "typescript";
|
|
11
9
|
|
|
@@ -971,7 +969,7 @@ function getHookCollector(context) {
|
|
|
971
969
|
const entry = getCurrentEntry();
|
|
972
970
|
if (entry == null) return;
|
|
973
971
|
const { body } = entry.node;
|
|
974
|
-
if (body.type === AST_NODE_TYPES
|
|
972
|
+
if (body.type === AST_NODE_TYPES.BlockStatement) return;
|
|
975
973
|
entry.rets.push(body);
|
|
976
974
|
},
|
|
977
975
|
CallExpression(node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "5.2.4-beta.
|
|
3
|
+
"version": "5.2.4-beta.5",
|
|
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": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@typescript-eslint/types": "^8.58.2",
|
|
35
35
|
"@typescript-eslint/utils": "^8.58.2",
|
|
36
36
|
"ts-pattern": "^5.9.0",
|
|
37
|
-
"@eslint-react/
|
|
38
|
-
"@eslint-react/
|
|
39
|
-
"@eslint-react/
|
|
40
|
-
"@eslint-react/shared": "5.2.4-beta.
|
|
41
|
-
"@eslint-react/var": "5.2.4-beta.
|
|
37
|
+
"@eslint-react/ast": "5.2.4-beta.5",
|
|
38
|
+
"@eslint-react/eslint": "5.2.4-beta.5",
|
|
39
|
+
"@eslint-react/jsx": "5.2.4-beta.5",
|
|
40
|
+
"@eslint-react/shared": "5.2.4-beta.5",
|
|
41
|
+
"@eslint-react/var": "5.2.4-beta.5"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@typescript-eslint/typescript-estree": "^8.58.2",
|