Open
Conversation
|
@richgilbank Cool project! The reason no errors are being reported is because you have not set const source = "let x: stri ng = 'string'";
const result = ts.transpileModule(source, {
reportDiagnostics: true
});
result.diagnostics
.filter(diagnostic => diagnostic.category === 1) // error
.map(diagnostic => typeof diagnostic.messageText === 'string'
? diagnostic.messageText
: diagnostic.messageText.messageText)
.forEach(message => console.error(message));
// '=' expected. |
Open
Owner
Author
|
Sorry for the incredibly slow response on this. Would like to get this up and running soon - should be able to find some time to work on it in the next little while. Thanks for the note @aluanhaddad, will take a look! Alternatively, feel free to submit a PR :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work in progress - This is not yet complete, as the error handling seems to be a little difficult (TypeScript seems to not be throwing SyntaxErrors, or anything else, when encountering broken syntax). Anyone more familiar with TypeScript's compiler who could lend a hand?
cc @yashprit or @hi104, who's already done great work on the TypeScript Playground on Ace
Ref: #35