@eslint-react/core 5.23.3 → 5.23.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 +1 -1
- package/dist/index.js +2 -9
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -427,7 +427,7 @@ export type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSe
|
|
|
427
427
|
* @param node The function node to analyze.
|
|
428
428
|
* @returns The identifier node if found, `null` otherwise.
|
|
429
429
|
*/
|
|
430
|
-
export declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | 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.
|
|
430
|
+
export declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | 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.YieldNoStarExpression | TSESTree.YieldStarExpression | null;
|
|
431
431
|
/**
|
|
432
432
|
* Get the initialization path of a function node in the AST.
|
|
433
433
|
*
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
|
3
3
|
import { randomBytes } from "node:crypto";
|
|
4
4
|
import { RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE } from "@eslint-react/shared";
|
|
5
5
|
import { resolve } from "@eslint-react/var";
|
|
6
|
-
import ts from "typescript";
|
|
7
6
|
import { P, isMatching, match } from "ts-pattern";
|
|
7
|
+
import ts from "typescript";
|
|
8
8
|
|
|
9
9
|
//#region src/api.ts
|
|
10
10
|
/**
|
|
@@ -627,14 +627,7 @@ function isJsxLike(context, node, hint = DEFAULT_JSX_DETECTION_HINT) {
|
|
|
627
627
|
case AST_NODE_TYPES.TSTypeAssertion:
|
|
628
628
|
case AST_NODE_TYPES.TSNonNullExpression: return visit(node.expression);
|
|
629
629
|
case AST_NODE_TYPES.AwaitExpression: return visit(node.argument);
|
|
630
|
-
case AST_NODE_TYPES.Literal:
|
|
631
|
-
switch (typeof node.value) {
|
|
632
|
-
case "boolean": return !(hint & JsxDetectionHint.DoNotIncludeJsxWithBooleanValue);
|
|
633
|
-
case "string": return !(hint & JsxDetectionHint.DoNotIncludeJsxWithStringValue);
|
|
634
|
-
case "number": return !(hint & JsxDetectionHint.DoNotIncludeJsxWithNumberValue);
|
|
635
|
-
case "bigint": return !(hint & JsxDetectionHint.DoNotIncludeJsxWithBigIntValue);
|
|
636
|
-
}
|
|
637
|
-
return node.value == null && !(hint & JsxDetectionHint.DoNotIncludeJsxWithNullValue);
|
|
630
|
+
case AST_NODE_TYPES.Literal: return match(node.value).with(P.nullish, () => !(hint & JsxDetectionHint.DoNotIncludeJsxWithNullValue)).with(P.boolean, () => !(hint & JsxDetectionHint.DoNotIncludeJsxWithBooleanValue)).with(P.string, () => !(hint & JsxDetectionHint.DoNotIncludeJsxWithStringValue)).with(P.number, () => !(hint & JsxDetectionHint.DoNotIncludeJsxWithNumberValue)).with(P.bigint, () => !(hint & JsxDetectionHint.DoNotIncludeJsxWithBigIntValue)).with(P.instanceOf(RegExp), () => false).exhaustive();
|
|
638
631
|
case AST_NODE_TYPES.TemplateLiteral: return !(hint & JsxDetectionHint.DoNotIncludeJsxWithStringValue);
|
|
639
632
|
case AST_NODE_TYPES.ArrayExpression:
|
|
640
633
|
if (node.elements.length === 0) return !(hint & JsxDetectionHint.DoNotIncludeJsxWithEmptyArrayValue);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "5.23.
|
|
3
|
+
"version": "5.23.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": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint-react/ast": "5.23.
|
|
33
|
-
"@eslint-react/eslint": "5.23.
|
|
34
|
-
"@eslint-react/shared": "5.23.
|
|
35
|
-
"@eslint-react/var": "5.23.
|
|
32
|
+
"@eslint-react/ast": "5.23.5",
|
|
33
|
+
"@eslint-react/eslint": "5.23.5",
|
|
34
|
+
"@eslint-react/shared": "5.23.5",
|
|
35
|
+
"@eslint-react/var": "5.23.5",
|
|
36
36
|
"@typescript-eslint/types": "^8.71.0",
|
|
37
37
|
"@typescript-eslint/utils": "^8.71.0",
|
|
38
38
|
"ts-pattern": "^5.9.0"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint": "^10.11.0",
|
|
46
46
|
"tsdown": "^0.23.0",
|
|
47
47
|
"typescript": "6.0.3",
|
|
48
|
-
"vitest": "^5.0.
|
|
48
|
+
"vitest": "^5.0.3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"eslint": "*",
|