Skip to content

Commit 6748f09

Browse files
committed
Linting, more tests
1 parent 1bc7b55 commit 6748f09

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

src/parsers/typeResolver.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export function resolveType(
4141
typeNode && ts.isTypeReferenceNode(typeNode)
4242
? checker.getSymbolAtLocation((typeNode as ts.TypeReferenceNode).typeName)
4343
: undefined;
44-
const declaredType = typeNodeSymbol ? checker.getDeclaredTypeOfSymbol(typeNodeSymbol) : undefined;
4544
const namespaces = typeNodeSymbol
4645
? getTypeSymbolNamespaces(typeNodeSymbol)
4746
: getTypeNamespaces(type);

test/aliases/input.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
export interface A {
22
a: Alias;
3+
r: MyRecord<string, string>;
34
}
45

6+
export function fn1(a: Alias, r: MyRecord<string, string>) {}
7+
58
type SomeType = 1 | 2;
69
type Alias = SomeType;
10+
type MyRecord<Key extends string | number, Value> = Record<Key, Value>;

test/aliases/output.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,56 @@
11
{
22
"name": "test/aliases/input",
33
"exports": [
4+
{
5+
"name": "fn1",
6+
"type": {
7+
"kind": "function",
8+
"name": "fn1",
9+
"parentNamespaces": [],
10+
"callSignatures": [
11+
{
12+
"parameters": [
13+
{
14+
"type": {
15+
"kind": "union",
16+
"types": [
17+
{
18+
"kind": "literal",
19+
"parentNamespaces": [],
20+
"value": 1
21+
},
22+
{
23+
"kind": "literal",
24+
"parentNamespaces": [],
25+
"value": 2
26+
}
27+
],
28+
"name": "Alias",
29+
"parentNamespaces": []
30+
},
31+
"name": "a",
32+
"optional": false
33+
},
34+
{
35+
"type": {
36+
"kind": "object",
37+
"name": "MyRecord",
38+
"parentNamespaces": [],
39+
"properties": []
40+
},
41+
"name": "r",
42+
"optional": false
43+
}
44+
],
45+
"returnValueType": {
46+
"kind": "intrinsic",
47+
"parentNamespaces": [],
48+
"name": "void"
49+
}
50+
}
51+
]
52+
}
53+
},
454
{
555
"name": "A",
656
"type": {
@@ -28,6 +78,16 @@
2878
"parentNamespaces": []
2979
},
3080
"optional": false
81+
},
82+
{
83+
"name": "r",
84+
"type": {
85+
"kind": "object",
86+
"name": "MyRecord",
87+
"parentNamespaces": [],
88+
"properties": []
89+
},
90+
"optional": false
3191
}
3292
]
3393
}

0 commit comments

Comments
 (0)