Skip to content

Commit

Permalink
run on node 4
Browse files Browse the repository at this point in the history
  • Loading branch information
vstirbu committed Oct 25, 2017
1 parent 4118a60 commit 64a7a95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ const options = {
moduleResolution: ts.ModuleResolutionKind.NodeJs
};

function prettifyDiagnostic(diagnostic) {
const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
const prettifyDiagnostic = (diagnostic) => {
const position = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
const line = position.line;
const character = position.character;
const messageText = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');

return `${diagnostic.file.fileName} (Ln ${line + 1}, Col ${character + 1}): ${messageText}`
Expand Down

0 comments on commit 64a7a95

Please sign in to comment.