@eslint-react/core 5.23.2 → 5.23.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 +2 -9
- package/package.json +6 -6
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.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": {
|
|
@@ -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.4",
|
|
33
|
+
"@eslint-react/eslint": "5.23.4",
|
|
34
|
+
"@eslint-react/shared": "5.23.4",
|
|
35
|
+
"@eslint-react/var": "5.23.4",
|
|
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": "*",
|