Conversation
Member
There was a problem hiding this comment.
Consider controlFlow.ts, but I like this too.
Closed
Member
There was a problem hiding this comment.
Leave a comment to explain that name is optional for the case of implicit labels.
Member
There was a problem hiding this comment.
Consider c.statements.length > 0
Contributor
|
👍 Awesome job! |
Member
|
We should put this back on the radar again. |
👍 |
|
IMO, it overlaps with TSLint. Regarding this, I'm concerned with the fact that I cannot use more mature JSHint or ESLint. Perhaps running them on the output (haven't tried that though). |
2 tasks
Contributor
Author
|
closed in favor of #4788 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR adds a basic control flow analysis to typescript compiler. Now it can detect unreachable code, implicit returns of undefined in functions, unused labels, fall- through between cases in switch statements. Some of these checks can be used in #393 or #274.
Disclaimer: This PR is not intended to be checked in as-is. What I rather want is to use it as a starting point to discuss: