In a switch, a case without break, return or throw runs on into the next case. Sometimes that is intended; more often a break is missing. noFallthroughCasesInSwitch reports every case that falls through after running code (TS7029).
Empty cases are allowed, so case "s": case "small": can still share one body. The option is not part of strict; the strict level of the jsconfig generator turns it on.
At a glance
| Write | "noFallthroughCasesInSwitch": true |
|---|---|
| On the command line | --noFallthroughCasesInSwitch |
| Type | boolean |
| Default in TypeScript 5.9 | false |
| TypeScript's description | Enable error reporting for fallthrough cases in switch statements. |
| Generator, relaxed | not written |
| Generator, recommended | not written |
| Generator, strict | true |
The description is quoted from TypeScript's own option list (Apache-2.0); see the notices. The generator rows are what the jsconfig generator writes at each level.
Examples
/** @param {string} size */
export function price(size) {
let cents = 0;
switch (size) {
case "s":
case "small":error TS7029: Fallthrough case in switch.
cents = 300;
case "large":
cents = 450;
break;
default:
cents = 400;
}
return cents;
}jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": [],
"noFallthroughCasesInSwitch": true
},
"include": [
"*.js"
]
} /** @param {string} size */
export function price(size) {
let cents = 0;
switch (size) {
case "s":
case "small":
cents = 300;
case "large":
cents = 450;
break;
default:
cents = 400;
}
return cents;
}jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": []
},
"include": [
"*.js"
]
} When you mean to fall through
Rewrite it so the intent is in the code: move the shared part into a function both cases call, or end the first case with an explicit return. There is no comment that marks one fall-through as intended.
Gotchas
- A case that ends in
return,throworcontinuedoes not fall through, so it is not reported.
Sources
- TSConfig Reference: noFallthroughCasesInSwitch · TypeScript
- TypeScript 1.8 release notes · TypeScript handbook
Last reviewed 20 October 2026.