Skip to content
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

Enable noFallthroughCasesInSwitch #19109

Closed
wants to merge 1 commit into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Oct 11, 2017

Since we have // @ts-ignore comments now, we don't need to use the lint rule for this any more.

@ghost ghost requested a review from weswigham October 11, 2017 20:24
@weswigham
Copy link
Member

I dislike this, since @ts-ignore squelches all errors on the following line. If we remove one of these syntax kinds for some reason (or just introduce a typo), that use site will not be marked as an error after the removal (or typo introduction). I dislike the collateral damage this causes in terms of potential safety losses - this feels way too clunky.

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Oct 12, 2017

. If we remove one of these syntax kinds for some reason

Precisely - we actually can detect cases when an enum will never match in a switch/case given accurate types, which you don't want to ignore.

@Jessidhia
Copy link

This goes back to the problem of not being able to specify which specific error is ignored by // @ts-ignore; it's just a blanket ignore all things marker.

Is there no provision for, say, a // fallthrough or // fallsthrough comment in the lint rule? I believe at least the eslint rule that checks for this supports such comments.

@ghost
Copy link
Author

ghost commented Oct 12, 2017

OK, let's wait on #9448 to be fixed first.
@Kovensky the tslint rule supports // falls through comments, but the TypeScript implementation does not.

@ghost ghost closed this Oct 12, 2017
@ghost ghost deleted the noFallthroughCasesInSwitch branch October 12, 2017 14:42
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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.

3 participants