mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
TS: Pass tsconfig options correctly
This commit is contained in:
@@ -253,7 +253,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
|
||||
fileExists: (path: string) => fs.existsSync(path),
|
||||
readFile: ts.sys.readFile,
|
||||
};
|
||||
let config = ts.parseJsonConfigFileContent(tsConfig, parseConfigHost, basePath);
|
||||
let config = ts.parseJsonConfigFileContent(tsConfig.config, parseConfigHost, basePath);
|
||||
let project = new Project(tsConfigFilename, config, state.typeTable);
|
||||
project.load();
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
exprType
|
||||
| tst.ts:1:5:1:16 | stringOrNUll | string \| null |
|
||||
| tst.ts:2:5:2:21 | stringOrUndefined | string \| undefined |
|
||||
| tst.ts:3:5:3:27 | stringO ... defined | string \| null \| undefined |
|
||||
| tst.ts:4:5:4:16 | stringOrVoid | string \| void |
|
||||
| tst.ts:7:5:7:21 | stringOrNullAlias | string \| null |
|
||||
| tst.ts:8:5:8:32 | stringO ... defined | string \| null \| undefined |
|
||||
| tst.ts:10:5:10:23 | arrayOfStringOrNull | (string \| null)[] |
|
||||
unaliasedType
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query Type exprType(Expr e) { result = e.getType() }
|
||||
|
||||
query Type unaliasedType(TypeAliasReference ref) { result = ref.getAliasedType() }
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"include": ["."],
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
let stringOrNUll: string | null;
|
||||
let stringOrUndefined: string | undefined;
|
||||
let stringOrNullOrUndefined: string | null | undefined;
|
||||
let stringOrVoid: string | void;
|
||||
|
||||
type StringOrNullAlias = string | null;
|
||||
let stringOrNullAlias: StringOrNullAlias;
|
||||
let stringOrNullAliasOrUndefined: StringOrNullAlias | undefined;
|
||||
|
||||
let arrayOfStringOrNull: Array<string | null>;
|
||||
Reference in New Issue
Block a user