corsa-oxlint 0.21.0 → 0.22.0
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/checker.js +15 -7
- package/dist/checker.js.map +1 -1
- package/package.json +2 -2
package/dist/checker.js
CHANGED
|
@@ -211,19 +211,27 @@ function corsaNodeFromEstree(context, node) {
|
|
|
211
211
|
function implementedTypesFromTypeAndBases(context, type, checker) {
|
|
212
212
|
const seenTypes = /* @__PURE__ */ new Set();
|
|
213
213
|
const seenImplementedTypes = /* @__PURE__ */ new Set();
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
const implemented = [];
|
|
215
|
+
const stack = [type];
|
|
216
|
+
while (stack.length > 0) {
|
|
217
|
+
const current = stack.pop();
|
|
218
|
+
if (seenTypes.has(current.id)) continue;
|
|
216
219
|
seenTypes.add(current.id);
|
|
217
|
-
const
|
|
218
|
-
for (
|
|
220
|
+
const ownImplemented = implementedTypesFromTypeDeclaration(context, current, checker);
|
|
221
|
+
for (let index = 0; index < ownImplemented.length; index += 1) {
|
|
222
|
+
const ownType = ownImplemented[index];
|
|
219
223
|
if (seenImplementedTypes.has(ownType.id)) continue;
|
|
220
224
|
seenImplementedTypes.add(ownType.id);
|
|
221
225
|
implemented.push(ownType);
|
|
222
226
|
}
|
|
223
|
-
|
|
224
|
-
|
|
227
|
+
const bases = checker.getBaseTypes(current);
|
|
228
|
+
for (let index = bases.length - 1; index >= 0; index -= 1) {
|
|
229
|
+
const baseType = bases[index];
|
|
230
|
+
if (seenTypes.has(baseType.id)) continue;
|
|
231
|
+
stack.push(baseType);
|
|
232
|
+
}
|
|
225
233
|
}
|
|
226
|
-
return
|
|
234
|
+
return implemented;
|
|
227
235
|
}
|
|
228
236
|
function implementedTypesFromTypeDeclaration(context, type, checker) {
|
|
229
237
|
const session = sessionForContext(context).session;
|
package/dist/checker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checker.js","names":[],"sources":["../ts/checker.ts"],"sourcesContent":["import type { Node } from \"@oxlint/plugins\";\n\nimport { createNodeMaps, toPosition } from \"./node_map\";\nimport { sessionForContext } from \"./registry\";\nimport type {\n ContextWithParserOptions,\n CorsaNode,\n CorsaProgramShape,\n CorsaSignature,\n CorsaSymbol,\n CorsaType,\n CorsaTypeCheckerShape,\n} from \"./types\";\n\nexport function createProgram(\n context: ContextWithParserOptions,\n): CorsaProgramShape & { readonly nodeMaps: ReturnType<typeof createNodeMaps> } {\n const nodeMaps = createNodeMaps(context);\n return {\n nodeMaps,\n getCompilerOptions() {\n return sessionForContext(context).session.getCompilerOptions();\n },\n getCurrentDirectory() {\n return sessionForContext(context).project.rootDir;\n },\n getRootFileNames() {\n return sessionForContext(context).session.getRootFileNames();\n },\n getSourceFile(fileName = context.filename) {\n return { fileName, text: context.sourceCode.text };\n },\n getTypeChecker() {\n return createTypeChecker(context);\n },\n };\n}\n\nexport function createTypeChecker(context: ContextWithParserOptions): CorsaTypeCheckerShape {\n return {\n getTypeAtLocation(node) {\n if ((node as { readonly type?: string }).type === \"NewExpression\") {\n return typeOfNewExpression(node as Node, this);\n }\n const lookupNode = nodeForTypeLookup(node);\n return sessionForContext(context).session.getTypeAtPosition(\n filenameFor(context, lookupNode),\n toPosition(lookupNode),\n sourceTextFor(context, lookupNode),\n );\n },\n getContextualType(node) {\n return this.getTypeAtLocation(node);\n },\n getSymbolAtLocation(node) {\n const lookupNode = nodeForTypeLookup(node);\n return sessionForContext(context).session.getSymbolAtPosition(\n filenameFor(context, lookupNode),\n toPosition(lookupNode),\n sourceTextFor(context, lookupNode),\n );\n },\n getSymbol(symbol) {\n return sessionForContext(context).session.getSymbol(symbol);\n },\n getSymbolById(id) {\n return sessionForContext(context).session.getSymbol(id);\n },\n getNode(node) {\n return sessionForContext(context).session.getNode(node);\n },\n getNodeById(id) {\n return sessionForContext(context).session.getNode(id);\n },\n getTypeOfSymbol(symbol) {\n return sessionForContext(context).session.getTypeOfSymbol(symbol);\n },\n getDeclaredTypeOfSymbol(symbol) {\n return sessionForContext(context).session.getDeclaredTypeOfSymbol(symbol);\n },\n getTypeOfSymbolAtLocation(symbol, node) {\n return (\n this.getTypeOfSymbol(symbol) ??\n this.getDeclaredTypeOfSymbol(symbol) ??\n this.getTypeAtLocation(node)\n );\n },\n typeToString(type, enclosingDeclaration, flags) {\n void enclosingDeclaration;\n return sessionForContext(context).session.typeToString(type, flags);\n },\n getBaseTypeOfLiteralType(type) {\n return sessionForContext(context).session.getBaseTypeOfLiteralType(type);\n },\n getPropertiesOfType(type) {\n return sessionForContext(context).session.getPropertiesOfType(type);\n },\n getSignaturesOfType(type, kind) {\n return sessionForContext(context).session.getSignaturesOfType(type, kind);\n },\n getReturnTypeOfSignature(signature) {\n return sessionForContext(context).session.getReturnTypeOfSignature(signature);\n },\n getTypePredicateOfSignature(signature) {\n return sessionForContext(context).session.getTypePredicateOfSignature(signature);\n },\n getBaseTypes(type) {\n return sessionForContext(context).session.getBaseTypes(type);\n },\n getImplementedTypes(node) {\n if (\"pos\" in node) {\n return implementedTypesFromCorsaNode(context, node, this);\n }\n const sourceText = sourceTextFor(context, node);\n const sourceNode = sourceText ? corsaNodeFromEstree(context, node) : undefined;\n if (sourceText && sourceNode) {\n const implemented = implementedTypesFromSourceText(sourceNode, sourceText, this);\n if (implemented.length > 0) {\n return implemented;\n }\n }\n return implementedClauseNodes(node)\n .map((clause) => {\n const expression = implementedClauseChildNode(clause, \"expression\") ?? clause;\n const symbol = this.getSymbolAtLocation(expression) ?? this.getSymbolAtLocation(clause);\n return symbol\n ? (this.getDeclaredTypeOfSymbol(symbol) ?? this.getTypeOfSymbol(symbol))\n : (this.getTypeAtLocation(expression) ?? this.getTypeAtLocation(clause));\n })\n .filter((type): type is CorsaType => type !== undefined);\n },\n getImplementedTypesOfType(type) {\n return implementedTypesFromTypeAndBases(context, type, this);\n },\n getTypeArguments(type) {\n return sessionForContext(context).session.getTypeArguments(type);\n },\n getTypesOfType(type) {\n return sessionForContext(context).session.getTypesOfType(type);\n },\n getTargetOfType(type) {\n return sessionForContext(context).session.getTargetOfType(type);\n },\n getTypeParametersOfType(type) {\n return sessionForContext(context).session.getTypeParametersOfType(type);\n },\n getOuterTypeParametersOfType(type) {\n return sessionForContext(context).session.getOuterTypeParametersOfType(type);\n },\n getLocalTypeParametersOfType(type) {\n return sessionForContext(context).session.getLocalTypeParametersOfType(type);\n },\n getObjectTypeOfType(type) {\n return sessionForContext(context).session.getObjectTypeOfType(type);\n },\n getIndexTypeOfType(type) {\n return sessionForContext(context).session.getIndexTypeOfType(type);\n },\n getCheckTypeOfType(type) {\n return sessionForContext(context).session.getCheckTypeOfType(type);\n },\n getExtendsTypeOfType(type) {\n return sessionForContext(context).session.getExtendsTypeOfType(type);\n },\n getBaseTypeOfType(type) {\n return sessionForContext(context).session.getBaseTypeOfType(type);\n },\n getConstraintOfType(type) {\n return sessionForContext(context).session.getConstraintOfType(type);\n },\n isUnionType(type) {\n return (type.flags & typeFlags.union) !== 0;\n },\n isIntersectionType(type) {\n return (type.flags & typeFlags.intersection) !== 0;\n },\n };\n}\n\nconst typeFlags = {\n union: 1 << 27,\n intersection: 1 << 28,\n} as const;\n\nfunction sourceTextFor(\n context: ContextWithParserOptions,\n node: Node | CorsaNode | CorsaType | CorsaSymbol | CorsaSignature,\n): string | undefined {\n return sourceTextForPath(context, filenameFor(context, node));\n}\n\nfunction sourceTextForPath(\n context: ContextWithParserOptions,\n fileName: string,\n): string | undefined {\n const normalizedFileName = fileName.toLowerCase();\n const normalizedContextFilename = context.filename.toLowerCase();\n return normalizedFileName === normalizedContextFilename ||\n normalizedFileName.endsWith(normalizedContextFilename) ||\n normalizedContextFilename.endsWith(normalizedFileName)\n ? context.sourceCode.text\n : sessionForContext(context).session.getSourceTextForPath(fileName);\n}\n\nfunction typeOfNewExpression(node: Node, checker: CorsaTypeCheckerShape): CorsaType | undefined {\n const callee = childNode(node, \"callee\");\n if (!callee) {\n return undefined;\n }\n const calleeType = checker.getTypeAtLocation(callee);\n if (!calleeType) {\n return undefined;\n }\n const constructSignature = checker.getSignaturesOfType(calleeType, 1)[0];\n return constructSignature\n ? (checker.getReturnTypeOfSignature(constructSignature) ?? calleeType)\n : calleeType;\n}\n\nfunction nodeForTypeLookup(node: Node | CorsaNode): Node | CorsaNode {\n if (\"pos\" in node) {\n return node;\n }\n switch ((node as { readonly type?: string }).type) {\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return childNode(node, \"id\") ?? node;\n case \"TSPropertySignature\":\n return childNode(node, \"key\") ?? node;\n default:\n return node;\n }\n}\n\nfunction childNode(node: Node, key: string): Node | undefined {\n const value = (node as unknown as Record<string, unknown>)[key];\n if (isNode(value)) {\n return value;\n }\n return undefined;\n}\n\nfunction implementedClauseNodes(node: Node | CorsaNode): readonly Node[] {\n if (\"pos\" in node) {\n return [];\n }\n const clauses = (node as unknown as { readonly implements?: unknown }).implements;\n if (!Array.isArray(clauses)) {\n return [];\n }\n return clauses.filter(isNode);\n}\n\nfunction implementedClauseChildNode(node: Node, key: string): Node | undefined {\n const value = (node as unknown as Record<string, unknown>)[key];\n if (isNode(value)) {\n return value;\n }\n return undefined;\n}\n\nfunction implementedTypesFromCorsaNode(\n context: ContextWithParserOptions,\n node: CorsaNode,\n checker: CorsaTypeCheckerShape,\n): readonly CorsaType[] {\n const symbol = checker.getSymbolAtLocation(node);\n if (symbol) {\n const declaredType = checker.getDeclaredTypeOfSymbol(symbol) ?? checker.getTypeOfSymbol(symbol);\n if (declaredType) {\n const implemented = checker.getImplementedTypesOfType(declaredType);\n if (implemented.length > 0) {\n return implemented;\n }\n }\n }\n const sourceText = sourceTextFor(context, node);\n if (sourceText) {\n return implementedTypesFromSourceText(node, sourceText, checker);\n }\n const type = checker.getTypeAtLocation(node);\n return type ? checker.getImplementedTypesOfType(type) : [];\n}\n\nfunction corsaNodeFromEstree(context: ContextWithParserOptions, node: Node): CorsaNode | undefined {\n const range = (node as { readonly range?: unknown }).range;\n if (\n !Array.isArray(range) ||\n range.length < 2 ||\n typeof range[0] !== \"number\" ||\n typeof range[1] !== \"number\"\n ) {\n return undefined;\n }\n return {\n fileName: context.filename,\n pos: range[0],\n end: range[1],\n range: [range[0], range[1]] as const,\n };\n}\n\nfunction implementedTypesFromTypeAndBases(\n context: ContextWithParserOptions,\n type: CorsaType,\n checker: CorsaTypeCheckerShape,\n): readonly CorsaType[] {\n const seenTypes = new Set<string>();\n const seenImplementedTypes = new Set<string>();\n\n function collect(current: CorsaType): CorsaType[] {\n if (seenTypes.has(current.id)) {\n return [];\n }\n seenTypes.add(current.id);\n\n const implemented: CorsaType[] = [];\n for (const ownType of implementedTypesFromTypeDeclaration(context, current, checker)) {\n if (seenImplementedTypes.has(ownType.id)) {\n continue;\n }\n seenImplementedTypes.add(ownType.id);\n implemented.push(ownType);\n }\n for (const baseType of checker.getBaseTypes(current)) {\n implemented.push(...collect(baseType));\n }\n return implemented;\n }\n\n return collect(type);\n}\n\nfunction implementedTypesFromTypeDeclaration(\n context: ContextWithParserOptions,\n type: CorsaType,\n checker: CorsaTypeCheckerShape,\n): readonly CorsaType[] {\n const session = sessionForContext(context).session;\n const symbol = type.symbol ? session.getSymbol(type.symbol) : undefined;\n const declaration = symbol?.valueDeclaration ?? symbol?.declarations?.[0];\n const declarationNode = declaration ? session.getNode(declaration) : undefined;\n const sourceText = declarationNode\n ? sourceTextForPath(context, declarationNode.fileName)\n : undefined;\n return declarationNode && sourceText\n ? implementedTypesFromSourceText(declarationNode, sourceText, checker)\n : [];\n}\n\nfunction implementedTypesFromSourceText(\n node: CorsaNode,\n sourceText: string,\n checker: CorsaTypeCheckerShape,\n): readonly CorsaType[] {\n if (node.pos < 0 || node.end > sourceText.length || node.pos >= node.end) {\n return [];\n }\n const classText = sourceText.slice(node.pos, node.end);\n const classStart = findKeywordOutsideTrivia(classText, \"class\");\n const headerStart = classStart >= 0 ? classStart : 0;\n const bodyOpen = findClassBodyOpen(classText, headerStart);\n const headerText = classText.slice(headerStart, bodyOpen >= 0 ? bodyOpen : classText.length);\n const implementsIndex = findKeywordOutsideTrivia(headerText, \"implements\");\n if (implementsIndex < 0) {\n return [];\n }\n const clauseText = headerText.slice(implementsIndex + \"implements\".length);\n const clauseStart = node.pos + headerStart + implementsIndex + \"implements\".length;\n return splitTopLevelRanges(clauseText, \",\")\n .map((range) => {\n const raw = clauseText.slice(range.start, range.end);\n const leading = raw.search(/\\S/);\n if (leading < 0) {\n return undefined;\n }\n const trailing = raw.match(/\\s*$/)?.[0].length ?? 0;\n const pos = clauseStart + range.start + leading;\n const end = clauseStart + range.end - trailing;\n const lookupNode: CorsaNode = {\n fileName: node.fileName,\n pos,\n end,\n range: [pos, end] as const,\n };\n const symbol = checker.getSymbolAtLocation(lookupNode);\n return symbol\n ? (checker.getDeclaredTypeOfSymbol(symbol) ?? checker.getTypeOfSymbol(symbol))\n : checker.getTypeAtLocation(lookupNode);\n })\n .filter((type): type is CorsaType => type !== undefined);\n}\n\nfunction findClassBodyOpen(text: string, start: number): number {\n const scanner = createScanner();\n let angleDepth = 0;\n let parenDepth = 0;\n let bracketDepth = 0;\n let braceDepth = 0;\n for (let index = start; index < text.length; index += 1) {\n const nextIndex = scanner.skip(text, index);\n if (nextIndex > index) {\n index = nextIndex - 1;\n continue;\n }\n const char = text[index];\n if (char === \"<\") angleDepth += 1;\n else if (char === \">\") angleDepth = Math.max(0, angleDepth - 1);\n else if (char === \"(\") parenDepth += 1;\n else if (char === \")\") parenDepth = Math.max(0, parenDepth - 1);\n else if (char === \"[\") bracketDepth += 1;\n else if (char === \"]\") bracketDepth = Math.max(0, bracketDepth - 1);\n else if (\n char === \"{\" &&\n angleDepth === 0 &&\n parenDepth === 0 &&\n bracketDepth === 0 &&\n braceDepth === 0\n ) {\n return index;\n } else if (char === \"{\") braceDepth += 1;\n else if (char === \"}\") braceDepth = Math.max(0, braceDepth - 1);\n }\n return -1;\n}\n\nfunction findKeywordOutsideTrivia(text: string, keyword: string): number {\n const scanner = createScanner();\n for (let index = 0; index < text.length; index += 1) {\n const nextIndex = scanner.skip(text, index);\n if (nextIndex > index) {\n index = nextIndex - 1;\n continue;\n }\n if (matchesKeyword(text, keyword, index)) {\n return index;\n }\n }\n return -1;\n}\n\nfunction matchesKeyword(text: string, keyword: string, index: number): boolean {\n return (\n text.startsWith(keyword, index) &&\n !isIdentifierPart(text[index - 1]) &&\n !isIdentifierPart(text[index + keyword.length])\n );\n}\n\nfunction isIdentifierPart(char: string | undefined): boolean {\n return char !== undefined && /[A-Za-z0-9_$]/.test(char);\n}\n\nfunction splitTopLevelRanges(\n text: string,\n delimiter: string,\n): readonly { readonly start: number; readonly end: number }[] {\n const ranges: { start: number; end: number }[] = [];\n const scanner = createScanner();\n let start = 0;\n let angleDepth = 0;\n let parenDepth = 0;\n let bracketDepth = 0;\n let braceDepth = 0;\n for (let index = 0; index < text.length; index += 1) {\n const char = text[index];\n const nextIndex = scanner.skip(text, index);\n if (nextIndex > index) {\n index = nextIndex - 1;\n continue;\n }\n if (char === \"<\") angleDepth += 1;\n else if (char === \">\") angleDepth = Math.max(0, angleDepth - 1);\n else if (char === \"(\") parenDepth += 1;\n else if (char === \")\") parenDepth = Math.max(0, parenDepth - 1);\n else if (char === \"[\") bracketDepth += 1;\n else if (char === \"]\") bracketDepth = Math.max(0, bracketDepth - 1);\n else if (char === \"{\") braceDepth += 1;\n else if (char === \"}\") braceDepth = Math.max(0, braceDepth - 1);\n else if (\n char === delimiter &&\n angleDepth === 0 &&\n parenDepth === 0 &&\n bracketDepth === 0 &&\n braceDepth === 0\n ) {\n ranges.push({ start, end: index });\n start = index + 1;\n }\n }\n ranges.push({ start, end: text.length });\n return ranges;\n}\n\nfunction createScanner(): {\n skip(text: string, index: number): number;\n} {\n let quote: string | undefined;\n let escaped = false;\n let inLineComment = false;\n let inBlockComment = false;\n return {\n skip(text, index) {\n const char = text[index];\n const next = text[index + 1];\n if (inLineComment) {\n if (char === \"\\n\" || char === \"\\r\") {\n inLineComment = false;\n }\n return index + 1;\n }\n if (inBlockComment) {\n if (char === \"*\" && next === \"/\") {\n inBlockComment = false;\n return index + 2;\n }\n return index + 1;\n }\n if (quote) {\n if (escaped) {\n escaped = false;\n } else if (char === \"\\\\\") {\n escaped = true;\n } else if (char === quote) {\n quote = undefined;\n }\n return index + 1;\n }\n if (char === \"/\" && next === \"/\") {\n inLineComment = true;\n return index + 2;\n }\n if (char === \"/\" && next === \"*\") {\n inBlockComment = true;\n return index + 2;\n }\n if (char === '\"' || char === \"'\" || char === \"`\") {\n quote = char;\n return index + 1;\n }\n return index;\n },\n };\n}\n\nfunction isNode(value: unknown): value is Node {\n return typeof value === \"object\" && value !== null && \"type\" in value && \"range\" in value;\n}\n\nfunction filenameFor(\n context: ContextWithParserOptions,\n node: Node | CorsaNode | CorsaType | CorsaSymbol | CorsaSignature,\n): string {\n if (\"fileName\" in node) {\n return node.fileName;\n }\n return context.filename;\n}\n"],"mappings":";;;AAcA,SAAgB,cACd,SAC8E;CAE9E,OAAO;EACL,UAFe,eAAe,QAEtB;EACR,qBAAqB;GACnB,OAAO,kBAAkB,QAAQ,CAAC,QAAQ,oBAAoB;;EAEhE,sBAAsB;GACpB,OAAO,kBAAkB,QAAQ,CAAC,QAAQ;;EAE5C,mBAAmB;GACjB,OAAO,kBAAkB,QAAQ,CAAC,QAAQ,kBAAkB;;EAE9D,cAAc,WAAW,QAAQ,UAAU;GACzC,OAAO;IAAE;IAAU,MAAM,QAAQ,WAAW;IAAM;;EAEpD,iBAAiB;GACf,OAAO,kBAAkB,QAAQ;;EAEpC;;AAGH,SAAgB,kBAAkB,SAA0D;CAC1F,OAAO;EACL,kBAAkB,MAAM;GACtB,IAAK,KAAoC,SAAS,iBAChD,OAAO,oBAAoB,MAAc,KAAK;GAEhD,MAAM,aAAa,kBAAkB,KAAK;GAC1C,OAAO,kBAAkB,QAAQ,CAAC,QAAQ,kBACxC,YAAY,SAAS,WAAW,EAChC,WAAW,WAAW,EACtB,cAAc,SAAS,WAAW,CACnC;;EAEH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AEjB,IAAI,SAAS,OAAO,SAAS,KAAK;GAChC,iBAAiB;GACjB,OAAO,QAAQ;;EAEjB,IAAI,SAAS,QAAO,SAAS,OAAO,SAAS,KAAK;GAChD,QAAQ;GACR,OAAO,QAAQ;;EAEjB,OAAO;IAEV;;AAGH,SAAS,OAAO,OAA+B;CAC7C,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU,SAAS,WAAW;;AAGtF,SAAS,YACP,SACA,MACQ;CACR,IAAI,cAAc,MAChB,OAAO,KAAK;CAEd,OAAO,QAAQ"}
|
|
1
|
+
{"version":3,"file":"checker.js","names":[],"sources":["../ts/checker.ts"],"sourcesContent":["import type { Node } from \"@oxlint/plugins\";\n\nimport { createNodeMaps, toPosition } from \"./node_map\";\nimport { sessionForContext } from \"./registry\";\nimport type {\n ContextWithParserOptions,\n CorsaNode,\n CorsaProgramShape,\n CorsaSignature,\n CorsaSymbol,\n CorsaType,\n CorsaTypeCheckerShape,\n} from \"./types\";\n\nexport function createProgram(\n context: ContextWithParserOptions,\n): CorsaProgramShape & { readonly nodeMaps: ReturnType<typeof createNodeMaps> } {\n const nodeMaps = createNodeMaps(context);\n return {\n nodeMaps,\n getCompilerOptions() {\n return sessionForContext(context).session.getCompilerOptions();\n },\n getCurrentDirectory() {\n return sessionForContext(context).project.rootDir;\n },\n getRootFileNames() {\n return sessionForContext(context).session.getRootFileNames();\n },\n getSourceFile(fileName = context.filename) {\n return { fileName, text: context.sourceCode.text };\n },\n getTypeChecker() {\n return createTypeChecker(context);\n },\n };\n}\n\nexport function createTypeChecker(context: ContextWithParserOptions): CorsaTypeCheckerShape {\n return {\n getTypeAtLocation(node) {\n if ((node as { readonly type?: string }).type === \"NewExpression\") {\n return typeOfNewExpression(node as Node, this);\n }\n const lookupNode = nodeForTypeLookup(node);\n return sessionForContext(context).session.getTypeAtPosition(\n filenameFor(context, lookupNode),\n toPosition(lookupNode),\n sourceTextFor(context, lookupNode),\n );\n },\n getContextualType(node) {\n return this.getTypeAtLocation(node);\n },\n getSymbolAtLocation(node) {\n const lookupNode = nodeForTypeLookup(node);\n return sessionForContext(context).session.getSymbolAtPosition(\n filenameFor(context, lookupNode),\n toPosition(lookupNode),\n sourceTextFor(context, lookupNode),\n );\n },\n getSymbol(symbol) {\n return sessionForContext(context).session.getSymbol(symbol);\n },\n getSymbolById(id) {\n return sessionForContext(context).session.getSymbol(id);\n },\n getNode(node) {\n return sessionForContext(context).session.getNode(node);\n },\n getNodeById(id) {\n return sessionForContext(context).session.getNode(id);\n },\n getTypeOfSymbol(symbol) {\n return sessionForContext(context).session.getTypeOfSymbol(symbol);\n },\n getDeclaredTypeOfSymbol(symbol) {\n return sessionForContext(context).session.getDeclaredTypeOfSymbol(symbol);\n },\n getTypeOfSymbolAtLocation(symbol, node) {\n return (\n this.getTypeOfSymbol(symbol) ??\n this.getDeclaredTypeOfSymbol(symbol) ??\n this.getTypeAtLocation(node)\n );\n },\n typeToString(type, enclosingDeclaration, flags) {\n void enclosingDeclaration;\n return sessionForContext(context).session.typeToString(type, flags);\n },\n getBaseTypeOfLiteralType(type) {\n return sessionForContext(context).session.getBaseTypeOfLiteralType(type);\n },\n getPropertiesOfType(type) {\n return sessionForContext(context).session.getPropertiesOfType(type);\n },\n getSignaturesOfType(type, kind) {\n return sessionForContext(context).session.getSignaturesOfType(type, kind);\n },\n getReturnTypeOfSignature(signature) {\n return sessionForContext(context).session.getReturnTypeOfSignature(signature);\n },\n getTypePredicateOfSignature(signature) {\n return sessionForContext(context).session.getTypePredicateOfSignature(signature);\n },\n getBaseTypes(type) {\n return sessionForContext(context).session.getBaseTypes(type);\n },\n getImplementedTypes(node) {\n if (\"pos\" in node) {\n return implementedTypesFromCorsaNode(context, node, this);\n }\n const sourceText = sourceTextFor(context, node);\n const sourceNode = sourceText ? corsaNodeFromEstree(context, node) : undefined;\n if (sourceText && sourceNode) {\n const implemented = implementedTypesFromSourceText(sourceNode, sourceText, this);\n if (implemented.length > 0) {\n return implemented;\n }\n }\n return implementedClauseNodes(node)\n .map((clause) => {\n const expression = implementedClauseChildNode(clause, \"expression\") ?? clause;\n const symbol = this.getSymbolAtLocation(expression) ?? this.getSymbolAtLocation(clause);\n return symbol\n ? (this.getDeclaredTypeOfSymbol(symbol) ?? this.getTypeOfSymbol(symbol))\n : (this.getTypeAtLocation(expression) ?? this.getTypeAtLocation(clause));\n })\n .filter((type): type is CorsaType => type !== undefined);\n },\n getImplementedTypesOfType(type) {\n return implementedTypesFromTypeAndBases(context, type, this);\n },\n getTypeArguments(type) {\n return sessionForContext(context).session.getTypeArguments(type);\n },\n getTypesOfType(type) {\n return sessionForContext(context).session.getTypesOfType(type);\n },\n getTargetOfType(type) {\n return sessionForContext(context).session.getTargetOfType(type);\n },\n getTypeParametersOfType(type) {\n return sessionForContext(context).session.getTypeParametersOfType(type);\n },\n getOuterTypeParametersOfType(type) {\n return sessionForContext(context).session.getOuterTypeParametersOfType(type);\n },\n getLocalTypeParametersOfType(type) {\n return sessionForContext(context).session.getLocalTypeParametersOfType(type);\n },\n getObjectTypeOfType(type) {\n return sessionForContext(context).session.getObjectTypeOfType(type);\n },\n getIndexTypeOfType(type) {\n return sessionForContext(context).session.getIndexTypeOfType(type);\n },\n getCheckTypeOfType(type) {\n return sessionForContext(context).session.getCheckTypeOfType(type);\n },\n getExtendsTypeOfType(type) {\n return sessionForContext(context).session.getExtendsTypeOfType(type);\n },\n getBaseTypeOfType(type) {\n return sessionForContext(context).session.getBaseTypeOfType(type);\n },\n getConstraintOfType(type) {\n return sessionForContext(context).session.getConstraintOfType(type);\n },\n isUnionType(type) {\n return (type.flags & typeFlags.union) !== 0;\n },\n isIntersectionType(type) {\n return (type.flags & typeFlags.intersection) !== 0;\n },\n };\n}\n\nconst typeFlags = {\n union: 1 << 27,\n intersection: 1 << 28,\n} as const;\n\nfunction sourceTextFor(\n context: ContextWithParserOptions,\n node: Node | CorsaNode | CorsaType | CorsaSymbol | CorsaSignature,\n): string | undefined {\n return sourceTextForPath(context, filenameFor(context, node));\n}\n\nfunction sourceTextForPath(\n context: ContextWithParserOptions,\n fileName: string,\n): string | undefined {\n const normalizedFileName = fileName.toLowerCase();\n const normalizedContextFilename = context.filename.toLowerCase();\n return normalizedFileName === normalizedContextFilename ||\n normalizedFileName.endsWith(normalizedContextFilename) ||\n normalizedContextFilename.endsWith(normalizedFileName)\n ? context.sourceCode.text\n : sessionForContext(context).session.getSourceTextForPath(fileName);\n}\n\nfunction typeOfNewExpression(node: Node, checker: CorsaTypeCheckerShape): CorsaType | undefined {\n const callee = childNode(node, \"callee\");\n if (!callee) {\n return undefined;\n }\n const calleeType = checker.getTypeAtLocation(callee);\n if (!calleeType) {\n return undefined;\n }\n const constructSignature = checker.getSignaturesOfType(calleeType, 1)[0];\n return constructSignature\n ? (checker.getReturnTypeOfSignature(constructSignature) ?? calleeType)\n : calleeType;\n}\n\nfunction nodeForTypeLookup(node: Node | CorsaNode): Node | CorsaNode {\n if (\"pos\" in node) {\n return node;\n }\n switch ((node as { readonly type?: string }).type) {\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return childNode(node, \"id\") ?? node;\n case \"TSPropertySignature\":\n return childNode(node, \"key\") ?? node;\n default:\n return node;\n }\n}\n\nfunction childNode(node: Node, key: string): Node | undefined {\n const value = (node as unknown as Record<string, unknown>)[key];\n if (isNode(value)) {\n return value;\n }\n return undefined;\n}\n\nfunction implementedClauseNodes(node: Node | CorsaNode): readonly Node[] {\n if (\"pos\" in node) {\n return [];\n }\n const clauses = (node as unknown as { readonly implements?: unknown }).implements;\n if (!Array.isArray(clauses)) {\n return [];\n }\n return clauses.filter(isNode);\n}\n\nfunction implementedClauseChildNode(node: Node, key: string): Node | undefined {\n const value = (node as unknown as Record<string, unknown>)[key];\n if (isNode(value)) {\n return value;\n }\n return undefined;\n}\n\nfunction implementedTypesFromCorsaNode(\n context: ContextWithParserOptions,\n node: CorsaNode,\n checker: CorsaTypeCheckerShape,\n): readonly CorsaType[] {\n const symbol = checker.getSymbolAtLocation(node);\n if (symbol) {\n const declaredType = checker.getDeclaredTypeOfSymbol(symbol) ?? checker.getTypeOfSymbol(symbol);\n if (declaredType) {\n const implemented = checker.getImplementedTypesOfType(declaredType);\n if (implemented.length > 0) {\n return implemented;\n }\n }\n }\n const sourceText = sourceTextFor(context, node);\n if (sourceText) {\n return implementedTypesFromSourceText(node, sourceText, checker);\n }\n const type = checker.getTypeAtLocation(node);\n return type ? checker.getImplementedTypesOfType(type) : [];\n}\n\nfunction corsaNodeFromEstree(context: ContextWithParserOptions, node: Node): CorsaNode | undefined {\n const range = (node as { readonly range?: unknown }).range;\n if (\n !Array.isArray(range) ||\n range.length < 2 ||\n typeof range[0] !== \"number\" ||\n typeof range[1] !== \"number\"\n ) {\n return undefined;\n }\n return {\n fileName: context.filename,\n pos: range[0],\n end: range[1],\n range: [range[0], range[1]] as const,\n };\n}\n\nfunction implementedTypesFromTypeAndBases(\n context: ContextWithParserOptions,\n type: CorsaType,\n checker: CorsaTypeCheckerShape,\n): readonly CorsaType[] {\n // Iterative DFS over the base chain so we don't pay for one closure call\n // and one `push(...subResult)` spread per base (each spread used to copy\n // the entire growing accumulator). Visit order doesn't matter because we\n // dedupe by `type.id`.\n const seenTypes = new Set<string>();\n const seenImplementedTypes = new Set<string>();\n const implemented: CorsaType[] = [];\n const stack: CorsaType[] = [type];\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (seenTypes.has(current.id)) {\n continue;\n }\n seenTypes.add(current.id);\n\n const ownImplemented = implementedTypesFromTypeDeclaration(context, current, checker);\n for (let index = 0; index < ownImplemented.length; index += 1) {\n const ownType = ownImplemented[index]!;\n if (seenImplementedTypes.has(ownType.id)) {\n continue;\n }\n seenImplementedTypes.add(ownType.id);\n implemented.push(ownType);\n }\n\n const bases = checker.getBaseTypes(current);\n // Push in reverse so the natural visit order matches the recursive form.\n for (let index = bases.length - 1; index >= 0; index -= 1) {\n const baseType = bases[index]!;\n if (seenTypes.has(baseType.id)) {\n continue;\n }\n stack.push(baseType);\n }\n }\n return implemented;\n}\n\nfunction implementedTypesFromTypeDeclaration(\n context: ContextWithParserOptions,\n type: CorsaType,\n checker: CorsaTypeCheckerShape,\n): readonly CorsaType[] {\n const session = sessionForContext(context).session;\n const symbol = type.symbol ? session.getSymbol(type.symbol) : undefined;\n const declaration = symbol?.valueDeclaration ?? symbol?.declarations?.[0];\n const declarationNode = declaration ? session.getNode(declaration) : undefined;\n const sourceText = declarationNode\n ? sourceTextForPath(context, declarationNode.fileName)\n : undefined;\n return declarationNode && sourceText\n ? implementedTypesFromSourceText(declarationNode, sourceText, checker)\n : [];\n}\n\nfunction implementedTypesFromSourceText(\n node: CorsaNode,\n sourceText: string,\n checker: CorsaTypeCheckerShape,\n): readonly CorsaType[] {\n if (node.pos < 0 || node.end > sourceText.length || node.pos >= node.end) {\n return [];\n }\n const classText = sourceText.slice(node.pos, node.end);\n const classStart = findKeywordOutsideTrivia(classText, \"class\");\n const headerStart = classStart >= 0 ? classStart : 0;\n const bodyOpen = findClassBodyOpen(classText, headerStart);\n const headerText = classText.slice(headerStart, bodyOpen >= 0 ? bodyOpen : classText.length);\n const implementsIndex = findKeywordOutsideTrivia(headerText, \"implements\");\n if (implementsIndex < 0) {\n return [];\n }\n const clauseText = headerText.slice(implementsIndex + \"implements\".length);\n const clauseStart = node.pos + headerStart + implementsIndex + \"implements\".length;\n return splitTopLevelRanges(clauseText, \",\")\n .map((range) => {\n const raw = clauseText.slice(range.start, range.end);\n const leading = raw.search(/\\S/);\n if (leading < 0) {\n return undefined;\n }\n const trailing = raw.match(/\\s*$/)?.[0].length ?? 0;\n const pos = clauseStart + range.start + leading;\n const end = clauseStart + range.end - trailing;\n const lookupNode: CorsaNode = {\n fileName: node.fileName,\n pos,\n end,\n range: [pos, end] as const,\n };\n const symbol = checker.getSymbolAtLocation(lookupNode);\n return symbol\n ? (checker.getDeclaredTypeOfSymbol(symbol) ?? checker.getTypeOfSymbol(symbol))\n : checker.getTypeAtLocation(lookupNode);\n })\n .filter((type): type is CorsaType => type !== undefined);\n}\n\nfunction findClassBodyOpen(text: string, start: number): number {\n const scanner = createScanner();\n let angleDepth = 0;\n let parenDepth = 0;\n let bracketDepth = 0;\n let braceDepth = 0;\n for (let index = start; index < text.length; index += 1) {\n const nextIndex = scanner.skip(text, index);\n if (nextIndex > index) {\n index = nextIndex - 1;\n continue;\n }\n const char = text[index];\n if (char === \"<\") angleDepth += 1;\n else if (char === \">\") angleDepth = Math.max(0, angleDepth - 1);\n else if (char === \"(\") parenDepth += 1;\n else if (char === \")\") parenDepth = Math.max(0, parenDepth - 1);\n else if (char === \"[\") bracketDepth += 1;\n else if (char === \"]\") bracketDepth = Math.max(0, bracketDepth - 1);\n else if (\n char === \"{\" &&\n angleDepth === 0 &&\n parenDepth === 0 &&\n bracketDepth === 0 &&\n braceDepth === 0\n ) {\n return index;\n } else if (char === \"{\") braceDepth += 1;\n else if (char === \"}\") braceDepth = Math.max(0, braceDepth - 1);\n }\n return -1;\n}\n\nfunction findKeywordOutsideTrivia(text: string, keyword: string): number {\n const scanner = createScanner();\n for (let index = 0; index < text.length; index += 1) {\n const nextIndex = scanner.skip(text, index);\n if (nextIndex > index) {\n index = nextIndex - 1;\n continue;\n }\n if (matchesKeyword(text, keyword, index)) {\n return index;\n }\n }\n return -1;\n}\n\nfunction matchesKeyword(text: string, keyword: string, index: number): boolean {\n return (\n text.startsWith(keyword, index) &&\n !isIdentifierPart(text[index - 1]) &&\n !isIdentifierPart(text[index + keyword.length])\n );\n}\n\nfunction isIdentifierPart(char: string | undefined): boolean {\n return char !== undefined && /[A-Za-z0-9_$]/.test(char);\n}\n\nfunction splitTopLevelRanges(\n text: string,\n delimiter: string,\n): readonly { readonly start: number; readonly end: number }[] {\n const ranges: { start: number; end: number }[] = [];\n const scanner = createScanner();\n let start = 0;\n let angleDepth = 0;\n let parenDepth = 0;\n let bracketDepth = 0;\n let braceDepth = 0;\n for (let index = 0; index < text.length; index += 1) {\n const char = text[index];\n const nextIndex = scanner.skip(text, index);\n if (nextIndex > index) {\n index = nextIndex - 1;\n continue;\n }\n if (char === \"<\") angleDepth += 1;\n else if (char === \">\") angleDepth = Math.max(0, angleDepth - 1);\n else if (char === \"(\") parenDepth += 1;\n else if (char === \")\") parenDepth = Math.max(0, parenDepth - 1);\n else if (char === \"[\") bracketDepth += 1;\n else if (char === \"]\") bracketDepth = Math.max(0, bracketDepth - 1);\n else if (char === \"{\") braceDepth += 1;\n else if (char === \"}\") braceDepth = Math.max(0, braceDepth - 1);\n else if (\n char === delimiter &&\n angleDepth === 0 &&\n parenDepth === 0 &&\n bracketDepth === 0 &&\n braceDepth === 0\n ) {\n ranges.push({ start, end: index });\n start = index + 1;\n }\n }\n ranges.push({ start, end: text.length });\n return ranges;\n}\n\nfunction createScanner(): {\n skip(text: string, index: number): number;\n} {\n let quote: string | undefined;\n let escaped = false;\n let inLineComment = false;\n let inBlockComment = false;\n return {\n skip(text, index) {\n const char = text[index];\n const next = text[index + 1];\n if (inLineComment) {\n if (char === \"\\n\" || char === \"\\r\") {\n inLineComment = false;\n }\n return index + 1;\n }\n if (inBlockComment) {\n if (char === \"*\" && next === \"/\") {\n inBlockComment = false;\n return index + 2;\n }\n return index + 1;\n }\n if (quote) {\n if (escaped) {\n escaped = false;\n } else if (char === \"\\\\\") {\n escaped = true;\n } else if (char === quote) {\n quote = undefined;\n }\n return index + 1;\n }\n if (char === \"/\" && next === \"/\") {\n inLineComment = true;\n return index + 2;\n }\n if (char === \"/\" && next === \"*\") {\n inBlockComment = true;\n return index + 2;\n }\n if (char === '\"' || char === \"'\" || char === \"`\") {\n quote = char;\n return index + 1;\n }\n return index;\n },\n };\n}\n\nfunction isNode(value: unknown): value is Node {\n return typeof value === \"object\" && value !== null && \"type\" in value && \"range\" in value;\n}\n\nfunction filenameFor(\n context: ContextWithParserOptions,\n node: Node | CorsaNode | CorsaType | CorsaSymbol | CorsaSignature,\n): string {\n if (\"fileName\" in node) {\n return node.fileName;\n }\n return context.filename;\n}\n"],"mappings":";;;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|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "corsa-oxlint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Type-aware Oxlint helpers powered by Corsa",
|
|
5
5
|
"homepage": "https://github.com/ubugeeei/corsa-bind/tree/main/src/bindings/nodejs/corsa_oxlint",
|
|
6
6
|
"bugs": {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"@oxlint/plugins": "1.66.0",
|
|
105
105
|
"oxlint": "1.66.0",
|
|
106
|
-
"@corsa-bind/napi": "0.
|
|
106
|
+
"@corsa-bind/napi": "0.22.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@typescript-eslint/utils": "8.59.3"
|