Skip to content

Commit

Permalink
Bump TypeScript to 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
iccir committed Mar 7, 2023
1 parent 198dae6 commit 946c89b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lodash": "4.x",
"node-getopt": "0.2.x",
"source-map": "0.5.x",
"typescript": "3.9.x"
"typescript": "4.9"
},
"scripts": {
"test": "mocha --ui tdd"
Expand Down
24 changes: 13 additions & 11 deletions src/typechecker/DiagnosticParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,22 @@ getWarnings(diagnostics, fileCallback)
fileName = fileCallback(fileName);
if (!fileName) return null;

let result = {
code: code,
column: lineColumn.column,
name: NSWarning.Typechecker,
file: fileName,
line: lineNumber,
reason: reason
};

// Only return if this error message is unique (defs can spam duplicate messages)
let key = result.file + ":" + result.line + ":" + result.reason;
let key = fileName + ":" + lineNumber + ":" + reason;

if (!duplicateMap[key]) {
duplicateMap[key] = true;
return result;

let error = new Error(reason);

error.name = NSWarning.Typechecker;
error.file = fileName;
error.line = lineNumber;
error.column = lineColumn.column;
error.reason = reason;
error.code = code;

return error;
}

return null;
Expand Down
2 changes: 2 additions & 0 deletions src/typechecker/Typechecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ async check(model, defs, files)
return sourceFile;
},

fileExists: () => { return false; },
readFile: () => { },
writeFile: () => { },
getDefaultLibFileName: options => ts.getDefaultLibFilePath(options),
useCaseSensitiveFileNames: () => false,
Expand Down

0 comments on commit 946c89b

Please sign in to comment.