Skip to content

noFallthroughCasesInSwitch complains about last case #6712

Closed
@domoritz

Description

@domoritz

I was a bit surprised that the last case also requires a break with noFallthroughCasesInSwitch in 1.8. Is that intentional?

switch (x % 2) {
    case 0:
        console.log("even");
         break;
    case 1: // Error: Fallthrough case in switch.
        console.log("odd");
    // no break here
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions