@r_masseater/oxlint-typed-rules 0.6.1 → 0.6.2
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/_typescript-default-CzTenk4q.mjs +141 -0
- package/dist/_typescript-default-CzTenk4q.mjs.map +1 -0
- package/dist/react.mjs +38 -39
- package/dist/react.mjs.map +1 -1
- package/dist/tanstack-start.mjs +21 -22
- package/dist/tanstack-start.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/version-BGaGRR5G.mjs +0 -83
- package/dist/version-BGaGRR5G.mjs.map +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { r as __exportAll } from "./rolldown-runtime-DQp2zzRu.mjs";
|
|
2
|
+
import { Array, Function, Option, Predicate } from "effect";
|
|
3
|
+
import { JsxEmit, JsxEmit as JsxEmit$1, SymbolFlags, SymbolFlags as SymbolFlags$1, TypeFlags, TypeFlags as TypeFlags$1 } from "tsrs/sync";
|
|
4
|
+
import { NodeFlags, NodeFlags as NodeFlags$1, SyntaxKind, SyntaxKind as SyntaxKind$1 } from "tsrs/ast";
|
|
5
|
+
import { isArrayBindingPattern, isArrayBindingPattern as isArrayBindingPattern$1, isArrowFunction, isArrowFunction as isArrowFunction$1, isBindingElement, isBindingElement as isBindingElement$1, isCallExpression, isCallExpression as isCallExpression$1, isClassDeclaration, isClassDeclaration as isClassDeclaration$1, isClassExpression, isClassExpression as isClassExpression$1, isComputedPropertyName, isComputedPropertyName as isComputedPropertyName$1, isEnumDeclaration, isEnumDeclaration as isEnumDeclaration$1, isEnumMember, isEnumMember as isEnumMember$1, isExpressionStatement, isExpressionStatement as isExpressionStatement$1, isFunctionDeclaration, isFunctionDeclaration as isFunctionDeclaration$1, isFunctionExpression, isFunctionExpression as isFunctionExpression$1, isIdentifier, isIdentifier as isIdentifier$1, isImportClause, isImportClause as isImportClause$1, isImportSpecifier, isImportSpecifier as isImportSpecifier$1, isInterfaceDeclaration, isInterfaceDeclaration as isInterfaceDeclaration$1, isIntersectionTypeNode, isIntersectionTypeNode as isIntersectionTypeNode$1, isJsxAttribute, isJsxAttribute as isJsxAttribute$1, isJsxExpression, isJsxExpression as isJsxExpression$1, isJsxOpeningElement, isJsxOpeningElement as isJsxOpeningElement$1, isJsxSelfClosingElement, isJsxSelfClosingElement as isJsxSelfClosingElement$1, isMappedTypeNode, isMappedTypeNode as isMappedTypeNode$1, isMethodDeclaration, isMethodDeclaration as isMethodDeclaration$1, isMethodSignatureDeclaration, isMethodSignatureDeclaration as isMethodSignature, isModuleDeclaration, isModuleDeclaration as isModuleDeclaration$1, isNamespaceExport, isNamespaceExport as isNamespaceExport$1, isNamespaceExportDeclaration, isNamespaceExportDeclaration as isNamespaceExportDeclaration$1, isNamespaceImport, isNamespaceImport as isNamespaceImport$1, isObjectBindingPattern, isObjectBindingPattern as isObjectBindingPattern$1, isObjectLiteralExpression, isObjectLiteralExpression as isObjectLiteralExpression$1, isParameterDeclaration, isParameterDeclaration as isParameter, isParenthesizedExpression, isParenthesizedExpression as isParenthesizedExpression$1, isPropertyAccessExpression, isPropertyAccessExpression as isPropertyAccessExpression$1, isPropertyAssignment, isPropertyAssignment as isPropertyAssignment$1, isPropertyDeclaration, isPropertyDeclaration as isPropertyDeclaration$1, isPropertySignatureDeclaration, isPropertySignatureDeclaration as isPropertySignature, isSourceFile, isSourceFile as isSourceFile$1, isStringLiteral, isStringLiteral as isStringLiteral$1, isTypeAliasDeclaration, isTypeAliasDeclaration as isTypeAliasDeclaration$1, isTypeLiteralNode, isTypeLiteralNode as isTypeLiteralNode$1, isTypeParameterDeclaration, isTypeParameterDeclaration as isTypeParameterDeclaration$1, isTypeQueryNode, isTypeQueryNode as isTypeQueryNode$1, isTypeReferenceNode, isTypeReferenceNode as isTypeReferenceNode$1, isUnionTypeNode, isUnionTypeNode as isUnionTypeNode$1, isVariableDeclaration, isVariableDeclaration as isVariableDeclaration$1, isVariableStatement, isVariableStatement as isVariableStatement$1 } from "tsrs/ast/is";
|
|
6
|
+
// src/shared/lib/ts-compat.ts
|
|
7
|
+
const FUNCTION_LIKE_KINDS = /* @__PURE__ */ new Set([
|
|
8
|
+
SyntaxKind.FunctionDeclaration,
|
|
9
|
+
SyntaxKind.MethodDeclaration,
|
|
10
|
+
SyntaxKind.Constructor,
|
|
11
|
+
SyntaxKind.GetAccessor,
|
|
12
|
+
SyntaxKind.SetAccessor,
|
|
13
|
+
SyntaxKind.FunctionExpression,
|
|
14
|
+
SyntaxKind.ArrowFunction,
|
|
15
|
+
SyntaxKind.MethodSignature,
|
|
16
|
+
SyntaxKind.CallSignature,
|
|
17
|
+
SyntaxKind.JSDocSignature,
|
|
18
|
+
SyntaxKind.ConstructSignature,
|
|
19
|
+
SyntaxKind.IndexSignature,
|
|
20
|
+
SyntaxKind.FunctionType,
|
|
21
|
+
SyntaxKind.ConstructorType
|
|
22
|
+
]);
|
|
23
|
+
const isFunctionLike = (node) => Option.fromNullishOr(node).pipe(Option.exists(({ kind }) => FUNCTION_LIKE_KINDS.has(kind)));
|
|
24
|
+
const forEachChild = Function.dual((args) => Array.head(Array.fromIterable(args)).pipe(Option.exists(Predicate.not(Predicate.isFunction))), (node, visit) => node.forEachChild(visit));
|
|
25
|
+
const ts = {
|
|
26
|
+
forEachChild,
|
|
27
|
+
isArrayBindingPattern,
|
|
28
|
+
isArrowFunction,
|
|
29
|
+
isBindingElement,
|
|
30
|
+
isCallExpression,
|
|
31
|
+
isClassDeclaration,
|
|
32
|
+
isClassExpression,
|
|
33
|
+
isComputedPropertyName,
|
|
34
|
+
isEnumDeclaration,
|
|
35
|
+
isEnumMember,
|
|
36
|
+
isExpressionStatement,
|
|
37
|
+
isFunctionDeclaration,
|
|
38
|
+
isFunctionExpression,
|
|
39
|
+
isFunctionLike,
|
|
40
|
+
isIdentifier,
|
|
41
|
+
isImportClause,
|
|
42
|
+
isImportSpecifier,
|
|
43
|
+
isInterfaceDeclaration,
|
|
44
|
+
isIntersectionTypeNode,
|
|
45
|
+
isJsxAttribute,
|
|
46
|
+
isJsxExpression,
|
|
47
|
+
isJsxOpeningElement,
|
|
48
|
+
isJsxSelfClosingElement,
|
|
49
|
+
isMappedTypeNode,
|
|
50
|
+
isMethodDeclaration,
|
|
51
|
+
isMethodSignature: isMethodSignatureDeclaration,
|
|
52
|
+
isModuleDeclaration,
|
|
53
|
+
isNamespaceExport,
|
|
54
|
+
isNamespaceExportDeclaration,
|
|
55
|
+
isNamespaceImport,
|
|
56
|
+
isObjectBindingPattern,
|
|
57
|
+
isObjectLiteralExpression,
|
|
58
|
+
isParameter: isParameterDeclaration,
|
|
59
|
+
isParenthesizedExpression,
|
|
60
|
+
isPropertyAccessExpression,
|
|
61
|
+
isPropertyAssignment,
|
|
62
|
+
isPropertyDeclaration,
|
|
63
|
+
isPropertySignature: isPropertySignatureDeclaration,
|
|
64
|
+
isSourceFile,
|
|
65
|
+
isStringLiteral,
|
|
66
|
+
isTypeAliasDeclaration,
|
|
67
|
+
isTypeLiteralNode,
|
|
68
|
+
isTypeParameterDeclaration,
|
|
69
|
+
isTypeQueryNode,
|
|
70
|
+
isTypeReferenceNode,
|
|
71
|
+
isUnionTypeNode,
|
|
72
|
+
isVariableDeclaration,
|
|
73
|
+
isVariableStatement,
|
|
74
|
+
JsxEmit,
|
|
75
|
+
NodeFlags,
|
|
76
|
+
SymbolFlags,
|
|
77
|
+
SyntaxKind,
|
|
78
|
+
TypeFlags
|
|
79
|
+
};
|
|
80
|
+
// \0typescript-default
|
|
81
|
+
var _typescript_default_exports = /* @__PURE__ */ __exportAll({
|
|
82
|
+
JsxEmit: () => JsxEmit$1,
|
|
83
|
+
NodeFlags: () => NodeFlags$1,
|
|
84
|
+
SymbolFlags: () => SymbolFlags$1,
|
|
85
|
+
SyntaxKind: () => SyntaxKind$1,
|
|
86
|
+
TypeFlags: () => TypeFlags$1,
|
|
87
|
+
default: () => _typescript_default_default,
|
|
88
|
+
forEachChild: () => forEachChild,
|
|
89
|
+
isArrayBindingPattern: () => isArrayBindingPattern$1,
|
|
90
|
+
isArrowFunction: () => isArrowFunction$1,
|
|
91
|
+
isBindingElement: () => isBindingElement$1,
|
|
92
|
+
isCallExpression: () => isCallExpression$1,
|
|
93
|
+
isClassDeclaration: () => isClassDeclaration$1,
|
|
94
|
+
isClassExpression: () => isClassExpression$1,
|
|
95
|
+
isComputedPropertyName: () => isComputedPropertyName$1,
|
|
96
|
+
isEnumDeclaration: () => isEnumDeclaration$1,
|
|
97
|
+
isEnumMember: () => isEnumMember$1,
|
|
98
|
+
isExpressionStatement: () => isExpressionStatement$1,
|
|
99
|
+
isFunctionDeclaration: () => isFunctionDeclaration$1,
|
|
100
|
+
isFunctionExpression: () => isFunctionExpression$1,
|
|
101
|
+
isFunctionLike: () => isFunctionLike,
|
|
102
|
+
isIdentifier: () => isIdentifier$1,
|
|
103
|
+
isImportClause: () => isImportClause$1,
|
|
104
|
+
isImportSpecifier: () => isImportSpecifier$1,
|
|
105
|
+
isInterfaceDeclaration: () => isInterfaceDeclaration$1,
|
|
106
|
+
isIntersectionTypeNode: () => isIntersectionTypeNode$1,
|
|
107
|
+
isJsxAttribute: () => isJsxAttribute$1,
|
|
108
|
+
isJsxExpression: () => isJsxExpression$1,
|
|
109
|
+
isJsxOpeningElement: () => isJsxOpeningElement$1,
|
|
110
|
+
isJsxSelfClosingElement: () => isJsxSelfClosingElement$1,
|
|
111
|
+
isMappedTypeNode: () => isMappedTypeNode$1,
|
|
112
|
+
isMethodDeclaration: () => isMethodDeclaration$1,
|
|
113
|
+
isMethodSignature: () => isMethodSignature,
|
|
114
|
+
isModuleDeclaration: () => isModuleDeclaration$1,
|
|
115
|
+
isNamespaceExport: () => isNamespaceExport$1,
|
|
116
|
+
isNamespaceExportDeclaration: () => isNamespaceExportDeclaration$1,
|
|
117
|
+
isNamespaceImport: () => isNamespaceImport$1,
|
|
118
|
+
isObjectBindingPattern: () => isObjectBindingPattern$1,
|
|
119
|
+
isObjectLiteralExpression: () => isObjectLiteralExpression$1,
|
|
120
|
+
isParameter: () => isParameter,
|
|
121
|
+
isParenthesizedExpression: () => isParenthesizedExpression$1,
|
|
122
|
+
isPropertyAccessExpression: () => isPropertyAccessExpression$1,
|
|
123
|
+
isPropertyAssignment: () => isPropertyAssignment$1,
|
|
124
|
+
isPropertyDeclaration: () => isPropertyDeclaration$1,
|
|
125
|
+
isPropertySignature: () => isPropertySignature,
|
|
126
|
+
isSourceFile: () => isSourceFile$1,
|
|
127
|
+
isStringLiteral: () => isStringLiteral$1,
|
|
128
|
+
isTypeAliasDeclaration: () => isTypeAliasDeclaration$1,
|
|
129
|
+
isTypeLiteralNode: () => isTypeLiteralNode$1,
|
|
130
|
+
isTypeParameterDeclaration: () => isTypeParameterDeclaration$1,
|
|
131
|
+
isTypeQueryNode: () => isTypeQueryNode$1,
|
|
132
|
+
isTypeReferenceNode: () => isTypeReferenceNode$1,
|
|
133
|
+
isUnionTypeNode: () => isUnionTypeNode$1,
|
|
134
|
+
isVariableDeclaration: () => isVariableDeclaration$1,
|
|
135
|
+
isVariableStatement: () => isVariableStatement$1,
|
|
136
|
+
ts: () => ts
|
|
137
|
+
});
|
|
138
|
+
var _typescript_default_default = ts;
|
|
139
|
+
export { isArrayBindingPattern$1 as a, isExpressionStatement$1 as c, isJsxOpeningElement$1 as d, isJsxSelfClosingElement$1 as f, isStringLiteral$1 as h, forEachChild as i, isFunctionLike as l, isParameter as m, _typescript_default_exports as n, isBindingElement$1 as o, isObjectBindingPattern$1 as p, SymbolFlags$1 as r, isCallExpression$1 as s, _typescript_default_default as t, isIdentifier$1 as u };
|
|
140
|
+
|
|
141
|
+
//# sourceMappingURL=_typescript-default-CzTenk4q.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_typescript-default-CzTenk4q.mjs","names":["Arr"],"sources":["../src/shared/lib/ts-compat.ts"],"sourcesContent":["import { Array as Arr, Function, Option, Predicate } from \"effect\";\nimport { NodeFlags, SyntaxKind } from \"tsrs/ast\";\nimport type { Node } from \"tsrs/ast\";\nimport {\n isArrayBindingPattern,\n isArrowFunction,\n isBindingElement,\n isCallExpression,\n isClassDeclaration,\n isClassExpression,\n isComputedPropertyName,\n isEnumDeclaration,\n isEnumMember,\n isExpressionStatement,\n isFunctionDeclaration,\n isFunctionExpression,\n isIdentifier,\n isImportClause,\n isImportSpecifier,\n isInterfaceDeclaration,\n isIntersectionTypeNode,\n isJsxAttribute,\n isJsxExpression,\n isJsxOpeningElement,\n isJsxSelfClosingElement,\n isMappedTypeNode,\n isMethodDeclaration,\n isMethodSignatureDeclaration,\n isModuleDeclaration,\n isNamespaceExport,\n isNamespaceExportDeclaration,\n isNamespaceImport,\n isObjectBindingPattern,\n isObjectLiteralExpression,\n isParameterDeclaration,\n isParenthesizedExpression,\n isPropertyAccessExpression,\n isPropertyAssignment,\n isPropertyDeclaration,\n isPropertySignatureDeclaration,\n isSourceFile,\n isStringLiteral,\n isTypeAliasDeclaration,\n isTypeLiteralNode,\n isTypeParameterDeclaration,\n isTypeQueryNode,\n isTypeReferenceNode,\n isUnionTypeNode,\n isVariableDeclaration,\n isVariableStatement,\n} from \"tsrs/ast/is\";\nimport { JsxEmit, SymbolFlags, TypeFlags } from \"tsrs/sync\";\n\nconst FUNCTION_LIKE_KINDS: ReadonlySet<SyntaxKind> = new Set([\n SyntaxKind.FunctionDeclaration,\n SyntaxKind.MethodDeclaration,\n SyntaxKind.Constructor,\n SyntaxKind.GetAccessor,\n SyntaxKind.SetAccessor,\n SyntaxKind.FunctionExpression,\n SyntaxKind.ArrowFunction,\n SyntaxKind.MethodSignature,\n SyntaxKind.CallSignature,\n SyntaxKind.JSDocSignature,\n SyntaxKind.ConstructSignature,\n SyntaxKind.IndexSignature,\n SyntaxKind.FunctionType,\n SyntaxKind.ConstructorType,\n]);\n\nexport const isFunctionLike = (node: Node | null | undefined): boolean =>\n Option.fromNullishOr(node).pipe(Option.exists(({ kind }) => FUNCTION_LIKE_KINDS.has(kind)));\n\nexport const forEachChild: {\n <Result>(visit: (child: Node) => Result | undefined): (node: Node) => Result | undefined;\n <Result>(node: Node, visit: (child: Node) => Result | undefined): Result | undefined;\n} = Function.dual(\n (args) =>\n Arr.head(Arr.fromIterable(args)).pipe(Option.exists(Predicate.not(Predicate.isFunction))),\n <Result>(node: Node, visit: (child: Node) => Result | undefined): Result | undefined =>\n node.forEachChild(visit),\n);\n\nexport const ts = {\n forEachChild,\n isArrayBindingPattern,\n isArrowFunction,\n isBindingElement,\n isCallExpression,\n isClassDeclaration,\n isClassExpression,\n isComputedPropertyName,\n isEnumDeclaration,\n isEnumMember,\n isExpressionStatement,\n isFunctionDeclaration,\n isFunctionExpression,\n isFunctionLike,\n isIdentifier,\n isImportClause,\n isImportSpecifier,\n isInterfaceDeclaration,\n isIntersectionTypeNode,\n isJsxAttribute,\n isJsxExpression,\n isJsxOpeningElement,\n isJsxSelfClosingElement,\n isMappedTypeNode,\n isMethodDeclaration,\n isMethodSignature: isMethodSignatureDeclaration,\n isModuleDeclaration,\n isNamespaceExport,\n isNamespaceExportDeclaration,\n isNamespaceImport,\n isObjectBindingPattern,\n isObjectLiteralExpression,\n isParameter: isParameterDeclaration,\n isParenthesizedExpression,\n isPropertyAccessExpression,\n isPropertyAssignment,\n isPropertyDeclaration,\n isPropertySignature: isPropertySignatureDeclaration,\n isSourceFile,\n isStringLiteral,\n isTypeAliasDeclaration,\n isTypeLiteralNode,\n isTypeParameterDeclaration,\n isTypeQueryNode,\n isTypeReferenceNode,\n isUnionTypeNode,\n isVariableDeclaration,\n isVariableStatement,\n JsxEmit,\n NodeFlags,\n SymbolFlags,\n SyntaxKind,\n TypeFlags,\n} as const;\n\nexport {\n isArrayBindingPattern,\n isArrowFunction,\n isBindingElement,\n isCallExpression,\n isClassDeclaration,\n isClassExpression,\n isComputedPropertyName,\n isEnumDeclaration,\n isEnumMember,\n isExpressionStatement,\n isFunctionDeclaration,\n isFunctionExpression,\n isIdentifier,\n isImportClause,\n isImportSpecifier,\n isInterfaceDeclaration,\n isIntersectionTypeNode,\n isJsxAttribute,\n isJsxExpression,\n isJsxOpeningElement,\n isJsxSelfClosingElement,\n isMappedTypeNode,\n isMethodDeclaration,\n isMethodSignatureDeclaration as isMethodSignature,\n isModuleDeclaration,\n isNamespaceExport,\n isNamespaceExportDeclaration,\n isNamespaceImport,\n isObjectBindingPattern,\n isObjectLiteralExpression,\n isParameterDeclaration as isParameter,\n isParenthesizedExpression,\n isPropertyAccessExpression,\n isPropertyAssignment,\n isPropertyDeclaration,\n isPropertySignatureDeclaration as isPropertySignature,\n isSourceFile,\n isStringLiteral,\n isTypeAliasDeclaration,\n isTypeLiteralNode,\n isTypeParameterDeclaration,\n isTypeQueryNode,\n isTypeReferenceNode,\n isUnionTypeNode,\n isVariableDeclaration,\n isVariableStatement,\n} from \"tsrs/ast/is\";\nexport { NodeFlags, SyntaxKind } from \"tsrs/ast\";\nexport { JsxEmit, SymbolFlags, TypeFlags } from \"tsrs/sync\";\n"],"mappings":";;;;;;AAqDA,MAAM,sCAA+C,IAAI,IAAI;CAC3D,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;AACb,CAAC;AAED,MAAa,kBAAkB,SAC7B,OAAO,cAAc,IAAI,CAAC,CAAC,KAAK,OAAO,QAAQ,EAAE,WAAW,oBAAoB,IAAI,IAAI,CAAC,CAAC;AAE5F,MAAa,eAGT,SAAS,MACV,SACCA,MAAI,KAAKA,MAAI,aAAa,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,OAAO,UAAU,IAAI,UAAU,UAAU,CAAC,CAAC,IACjF,MAAY,UACnB,KAAK,aAAa,KAAK,CAC3B;AAEA,MAAa,KAAK;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,mBAAmB;CACnB;CACA;CACA;CACA;CACA;CACA;CACA,aAAa;CACb;CACA;CACA;CACA;CACA,qBAAqB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
package/dist/react.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as __toESM, t as __commonJSMin } from "./rolldown-runtime-DQp2zzRu.mjs";
|
|
2
2
|
import { n as require_dist$2, t as require_eslint_utils$2 } from "./eslint-utils-0ZLZ6vu2.mjs";
|
|
3
|
-
import { t as
|
|
3
|
+
import { t as _typescript_default_default } from "./_typescript-default-CzTenk4q.mjs";
|
|
4
4
|
import { a as withTypeInformation, i as withOptionalTypeInformation, t as isTypedRule } from "./typed-rule-FCRt1nKZ.mjs";
|
|
5
5
|
import { t as rulesOf } from "./config-rules-Buk48gLL.mjs";
|
|
6
6
|
import module$1 from "node:module";
|
|
@@ -17168,7 +17168,6 @@ function resolveOriginChain(context, node, options) {
|
|
|
17168
17168
|
return check_exports.isIdentifier(current) ? null : current;
|
|
17169
17169
|
}
|
|
17170
17170
|
// ../../node_modules/.pnpm/@eslint-react+core@5.30.6_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__supports-col_45528ca5636b4b4c8e1207836370cda6/node_modules/@eslint-react/core/dist/index.js
|
|
17171
|
-
var import_version = /* @__PURE__ */ __toESM(require_version(), 1);
|
|
17172
17171
|
function isAPI(api) {
|
|
17173
17172
|
function impl(context, node) {
|
|
17174
17173
|
if (node == null) return false;
|
|
@@ -17874,7 +17873,7 @@ const mergedCache = /* @__PURE__ */ new WeakMap();
|
|
|
17874
17873
|
function getJSXConfigFromCompilerOptions(context) {
|
|
17875
17874
|
const options = context.sourceCode.parserServices?.program?.getCompilerOptions() ?? {};
|
|
17876
17875
|
return {
|
|
17877
|
-
jsx: options.jsx ??
|
|
17876
|
+
jsx: options.jsx ?? _typescript_default_default.JsxEmit.ReactJSX,
|
|
17878
17877
|
jsxFactory: options.jsxFactory ?? "React.createElement",
|
|
17879
17878
|
jsxFragmentFactory: options.jsxFragmentFactory ?? "React.Fragment",
|
|
17880
17879
|
jsxImportSource: options.jsxImportSource ?? "react"
|
|
@@ -17898,8 +17897,8 @@ function getJSXConfigFromAnnotation(context) {
|
|
|
17898
17897
|
}
|
|
17899
17898
|
if (jsx != null) options.jsxFactory = jsx;
|
|
17900
17899
|
if (jsxFrag != null) options.jsxFragmentFactory = jsxFrag;
|
|
17901
|
-
if (jsxRuntime === "classic") options.jsx =
|
|
17902
|
-
else if (jsxRuntime === "automatic") options.jsx =
|
|
17900
|
+
if (jsxRuntime === "classic") options.jsx = _typescript_default_default.JsxEmit.React;
|
|
17901
|
+
else if (jsxRuntime === "automatic") options.jsx = _typescript_default_default.JsxEmit.ReactJSX;
|
|
17903
17902
|
if (jsxImportSource != null) options.jsxImportSource = jsxImportSource;
|
|
17904
17903
|
annotationCache.set(context.sourceCode, options);
|
|
17905
17904
|
return options;
|
|
@@ -17921,69 +17920,69 @@ function isFlagSetOnObject(obj, flag) {
|
|
|
17921
17920
|
return isFlagSet(obj.flags, flag);
|
|
17922
17921
|
}
|
|
17923
17922
|
const isTypeFlagSet = isFlagSetOnObject;
|
|
17924
|
-
const isBooleanLiteralType = (type) => isTypeFlagSet(type,
|
|
17923
|
+
const isBooleanLiteralType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.BooleanLiteral);
|
|
17925
17924
|
const isFalseLiteralType = (type) => isBooleanLiteralType(type) && type.intrinsicName === "false";
|
|
17926
17925
|
const isTrueLiteralType = (type) => isBooleanLiteralType(type) && type.intrinsicName === "true";
|
|
17927
|
-
const isAnyType = (type) => isTypeFlagSet(type,
|
|
17928
|
-
const isBigIntType = (type) => isTypeFlagSet(type,
|
|
17929
|
-
const isBooleanType = (type) => isTypeFlagSet(type,
|
|
17930
|
-
const isEnumType = (type) => isTypeFlagSet(type,
|
|
17926
|
+
const isAnyType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.TypeParameter | _typescript_default_default.TypeFlags.Any);
|
|
17927
|
+
const isBigIntType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.BigIntLike);
|
|
17928
|
+
const isBooleanType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.BooleanLike);
|
|
17929
|
+
const isEnumType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.EnumLike);
|
|
17931
17930
|
const isFalsyBigIntType = (type) => type.isLiteral() && u$1({ value: { base10Value: "0" } }, type);
|
|
17932
17931
|
const isFalsyNumberType = (type) => type.isNumberLiteral() && type.value === 0;
|
|
17933
17932
|
const isFalsyStringType = (type) => type.isStringLiteral() && type.value === "";
|
|
17934
|
-
const isNeverType = (type) => isTypeFlagSet(type,
|
|
17935
|
-
const isNullishType = (type) => isTypeFlagSet(type,
|
|
17936
|
-
const isNumberType = (type) => isTypeFlagSet(type,
|
|
17937
|
-
const isObjectType = (type) => !isTypeFlagSet(type,
|
|
17938
|
-
const isStringType = (type) => isTypeFlagSet(type,
|
|
17933
|
+
const isNeverType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.Never);
|
|
17934
|
+
const isNullishType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.Null | _typescript_default_default.TypeFlags.Undefined | _typescript_default_default.TypeFlags.VoidLike);
|
|
17935
|
+
const isNumberType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.NumberLike);
|
|
17936
|
+
const isObjectType = (type) => !isTypeFlagSet(type, _typescript_default_default.TypeFlags.Null | _typescript_default_default.TypeFlags.Undefined | _typescript_default_default.TypeFlags.VoidLike | _typescript_default_default.TypeFlags.BooleanLike | _typescript_default_default.TypeFlags.StringLike | _typescript_default_default.TypeFlags.NumberLike | _typescript_default_default.TypeFlags.BigIntLike | _typescript_default_default.TypeFlags.ESSymbolLike | _typescript_default_default.TypeFlags.TypeParameter | _typescript_default_default.TypeFlags.Any | _typescript_default_default.TypeFlags.Unknown | _typescript_default_default.TypeFlags.Never);
|
|
17937
|
+
const isStringType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.StringLike);
|
|
17939
17938
|
const isTruthyBigIntType = (type) => type.isLiteral() && u$1({ value: { base10Value: z$1.not("0") } }, type);
|
|
17940
17939
|
const isTruthyNumberType = (type) => type.isNumberLiteral() && type.value !== 0;
|
|
17941
17940
|
const isTruthyStringType = (type) => type.isStringLiteral() && type.value !== "";
|
|
17942
|
-
const isUnknownType = (type) => isTypeFlagSet(type,
|
|
17941
|
+
const isUnknownType = (type) => isTypeFlagSet(type, _typescript_default_default.TypeFlags.Unknown);
|
|
17943
17942
|
function getFullyQualifiedName(checker, symbol) {
|
|
17944
17943
|
let name = symbol.name;
|
|
17945
17944
|
let parent = symbol.declarations?.at(0)?.parent;
|
|
17946
17945
|
if (parent == null) return checker.getFullyQualifiedName(symbol);
|
|
17947
17946
|
let inGlobalAugmentation = false;
|
|
17948
|
-
while (!
|
|
17947
|
+
while (!_typescript_default_default.isSourceFile(parent)) {
|
|
17949
17948
|
switch (true) {
|
|
17950
|
-
case
|
|
17951
|
-
case
|
|
17952
|
-
case
|
|
17949
|
+
case _typescript_default_default.isInterfaceDeclaration(parent):
|
|
17950
|
+
case _typescript_default_default.isTypeAliasDeclaration(parent):
|
|
17951
|
+
case _typescript_default_default.isEnumDeclaration(parent):
|
|
17953
17952
|
name = `${parent.name.text}.${name}`;
|
|
17954
17953
|
break;
|
|
17955
|
-
case
|
|
17956
|
-
if ((parent.flags &
|
|
17954
|
+
case _typescript_default_default.isModuleDeclaration(parent):
|
|
17955
|
+
if ((parent.flags & _typescript_default_default.NodeFlags.GlobalAugmentation) !== 0) {
|
|
17957
17956
|
inGlobalAugmentation = true;
|
|
17958
17957
|
break;
|
|
17959
17958
|
}
|
|
17960
17959
|
name = `${parent.name.text}.${name}`;
|
|
17961
17960
|
break;
|
|
17962
|
-
case
|
|
17963
|
-
case
|
|
17964
|
-
case
|
|
17965
|
-
case
|
|
17966
|
-
case
|
|
17967
|
-
case
|
|
17961
|
+
case _typescript_default_default.isPropertySignature(parent) && _typescript_default_default.isIdentifier(parent.name):
|
|
17962
|
+
case _typescript_default_default.isPropertyDeclaration(parent) && _typescript_default_default.isIdentifier(parent.name):
|
|
17963
|
+
case _typescript_default_default.isMethodDeclaration(parent) && _typescript_default_default.isIdentifier(parent.name):
|
|
17964
|
+
case _typescript_default_default.isMethodSignature(parent) && _typescript_default_default.isIdentifier(parent.name):
|
|
17965
|
+
case _typescript_default_default.isPropertyAssignment(parent) && _typescript_default_default.isIdentifier(parent.name):
|
|
17966
|
+
case _typescript_default_default.isVariableDeclaration(parent) && _typescript_default_default.isIdentifier(parent.name):
|
|
17968
17967
|
name = `${parent.name.text}.${name}`;
|
|
17969
17968
|
break;
|
|
17970
|
-
case
|
|
17971
|
-
case
|
|
17972
|
-
case
|
|
17969
|
+
case _typescript_default_default.isFunctionDeclaration(parent) && parent.name != null:
|
|
17970
|
+
case _typescript_default_default.isClassExpression(parent) && parent.name != null:
|
|
17971
|
+
case _typescript_default_default.isClassDeclaration(parent) && parent.name != null:
|
|
17973
17972
|
name = `${parent.name.text}.${name}`;
|
|
17974
17973
|
break;
|
|
17975
|
-
case
|
|
17974
|
+
case _typescript_default_default.isEnumMember(parent) && !_typescript_default_default.isComputedPropertyName(parent.name):
|
|
17976
17975
|
name = `${parent.name.text}.${name}`;
|
|
17977
17976
|
break;
|
|
17978
|
-
case
|
|
17979
|
-
case
|
|
17980
|
-
case
|
|
17981
|
-
case
|
|
17982
|
-
case
|
|
17977
|
+
case _typescript_default_default.isTypeLiteralNode(parent):
|
|
17978
|
+
case _typescript_default_default.isMappedTypeNode(parent):
|
|
17979
|
+
case _typescript_default_default.isObjectLiteralExpression(parent):
|
|
17980
|
+
case _typescript_default_default.isIntersectionTypeNode(parent):
|
|
17981
|
+
case _typescript_default_default.isUnionTypeNode(parent):
|
|
17983
17982
|
}
|
|
17984
17983
|
parent = parent.parent;
|
|
17985
17984
|
}
|
|
17986
|
-
const namespace = parent.statements.find((n) =>
|
|
17985
|
+
const namespace = parent.statements.find((n) => _typescript_default_default.isNamespaceExportDeclaration(n))?.name.text;
|
|
17987
17986
|
if (namespace == null || inGlobalAugmentation) return name;
|
|
17988
17987
|
if (name === namespace || name.startsWith(`${namespace}.`)) return name;
|
|
17989
17988
|
return `${namespace}.${name}`;
|
|
@@ -28764,7 +28763,7 @@ var no_key_after_spread_default = createRule$3({
|
|
|
28764
28763
|
function create$4$3(context) {
|
|
28765
28764
|
if (!/key\s*=/.test(context.sourceCode.text)) return {};
|
|
28766
28765
|
const { jsx } = getJSXConfig(context);
|
|
28767
|
-
if (jsx !==
|
|
28766
|
+
if (jsx !== _typescript_default_default.JsxEmit.ReactJSX && jsx !== _typescript_default_default.JsxEmit.ReactJSXDev) return {};
|
|
28768
28767
|
return { JSXOpeningElement(node) {
|
|
28769
28768
|
for (const n of dropWhile(node.attributes, not(check_exports.isJSXSpreadAttribute)).filter(isPlainAttribute("key"))) context.report({
|
|
28770
28769
|
messageId: "default",
|