All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rules.tslint.no-switch-case-fall-through.html Maven / Gradle / Ivy

Go to download

Consume reports generated by tslint for code quality. Also consume reports for code duplication (either simian or cpd). Consumes the unit/integration tests reports (generated by Jasmin) coverage report (lcov generated by Istanbul). The information generated by reports are added in Sonar

The newest version!

Details

Rule: no-switch-case-fall-through

Disallows falling through case statements.

For example, the following is not allowed:

switch(foo) {
case 1:
someFunc(foo);
case 2:
someOtherFunc(foo);
}

However, fall through is allowed when case statements are consecutive or a magic /* falls through */ comment is present. The following is valid:

switch(foo) {
case 1:
someFunc(foo);
/* falls through */
case 2:
case 3:
someOtherFunc(foo);
}
Rationale

Fall though in switch statements is often unintentional and a bug.

Config

Not configurable.

Examples
"no-switch-case-fall-through": true
Schema
{}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy