Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c41d69

Browse files
committed
TS: Pass tsconfig options correctly
1 parent 23f8d27 commit 0c41d69

5 files changed

Lines changed: 31 additions & 1 deletion

File tree

javascript/extractor/lib/typescript/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
253253
fileExists: (path: string) => fs.existsSync(path),
254254
readFile: ts.sys.readFile,
255255
};
256-
let config = ts.parseJsonConfigFileContent(tsConfig, parseConfigHost, basePath);
256+
let config = ts.parseJsonConfigFileContent(tsConfig.config, parseConfigHost, basePath);
257257
let project = new Project(tsConfigFilename, config, state.typeTable);
258258
project.load();
259259

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
exprType
2+
| tst.ts:1:5:1:16 | stringOrNUll | string \| null |
3+
| tst.ts:2:5:2:21 | stringOrUndefined | string \| undefined |
4+
| tst.ts:3:5:3:27 | stringO ... defined | string \| null \| undefined |
5+
| tst.ts:4:5:4:16 | stringOrVoid | string \| void |
6+
| tst.ts:7:5:7:21 | stringOrNullAlias | string \| null |
7+
| tst.ts:8:5:8:32 | stringO ... defined | string \| null \| undefined |
8+
| tst.ts:10:5:10:23 | arrayOfStringOrNull | (string \| null)[] |
9+
unaliasedType
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import javascript
2+
3+
query Type exprType(Expr e) { result = e.getType() }
4+
5+
query Type unaliasedType(TypeAliasReference ref) { result = ref.getAliasedType() }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"include": ["."],
3+
"compilerOptions": {
4+
"strict": true
5+
}
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
let stringOrNUll: string | null;
2+
let stringOrUndefined: string | undefined;
3+
let stringOrNullOrUndefined: string | null | undefined;
4+
let stringOrVoid: string | void;
5+
6+
type StringOrNullAlias = string | null;
7+
let stringOrNullAlias: StringOrNullAlias;
8+
let stringOrNullAliasOrUndefined: StringOrNullAlias | undefined;
9+
10+
let arrayOfStringOrNull: Array<string | null>;

0 commit comments

Comments
 (0)