Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-switch-case-fall-through does not handle braces correctly #2504

Closed
sschoeb opened this issue Apr 5, 2017 · 1 comment
Closed

no-switch-case-fall-through does not handle braces correctly #2504

sschoeb opened this issue Apr 5, 2017 · 1 comment

Comments

@sschoeb
Copy link

sschoeb commented Apr 5, 2017

Bug Report

  • TSLint version: 4.3.1
  • TypeScript version: 2.2.1
  • Running TSLint via: cli

TypeScript code being linted

  public testfunc(): string {
    let test = 'bla';
    switch (test) {
      case 'bla': {
        return 'Hallo in case';
      }
      case 'blub':
        return 'Hello blub';
    }

    return 'Hallo outside';
  }

with tslint.json configuration:

    "no-switch-case-fall-through": true,

Actual behavior

I got an error that there is a break statement expected before the case
src/app/shared/demo.ts[25, 7]: expected a 'break' before 'case'

It works without the braces around case 'bla'

Expected behavior

Working with braces.

@ajafff
Copy link
Contributor

ajafff commented Apr 5, 2017

This is fixed by #2218 and released with tslint v4.5.0

@sschoeb sschoeb closed this as completed Apr 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants