Skip to content

Add suggestion diagnostics for unused label and unreachable code #24261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2 commits merged into from
May 22, 2018

Conversation

ghost
Copy link

@ghost ghost commented May 18, 2018

Fixes #24026

This means that unreachable-code and unused-label diagnostics will no longer show up in the command line by default (though they will with --allowUnreachableCode false --allowUnusedLabel false), but they will show up in the editor as suggestions. Note if --allowUnreachableCode true is set, there will not even be a suggestion.

@ghost ghost requested review from mhegazy and sheetalkamat May 18, 2018 23:35
@ghost
Copy link
Author

ghost commented May 18, 2018

TODO: Come up with new descriptions for the --allowUnreachableCode and --allowUnusedLabels compiler options.

@ghost ghost force-pushed the bindSuggestionDiagnostics branch from 536123f to ad620b8 Compare May 18, 2018 23:42
@@ -33,9 +33,7 @@ tests/cases/conformance/jsx/16.tsx(1,2): error TS17008: JSX element 'a' has no c
tests/cases/conformance/jsx/16.tsx(1,10): error TS1005: '</' expected.
tests/cases/conformance/jsx/17.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag.
tests/cases/conformance/jsx/17.tsx(1,10): error TS1005: '</' expected.
tests/cases/conformance/jsx/18.tsx(1,9): error TS2695: Left side of comma operator is unused and has no side effects.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was actually a good error usually... caught some obvious bugs.. do not know about disabling it by default..

@ghost ghost force-pushed the bindSuggestionDiagnostics branch from be5783d to bb4e4d6 Compare May 21, 2018 18:38
@ghost ghost merged commit 982c8d0 into master May 22, 2018
@ghost ghost deleted the bindSuggestionDiagnostics branch May 22, 2018 14:56
@mhegazy mhegazy mentioned this pull request May 22, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants