jsconfig.json option

noFallthroughCasesInSwitch

  • Default false
  • Since TypeScript 1.8

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

main.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: main.js(7,5): error TS7029: Fallthrough case in switch. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. main.js(7,5): error TS7029: Fallthrough case in switch. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. main.js(7,5): error TS7029: Fallthrough case in switch. checked 21 October 2026
/** @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;
}
noFallthroughCasesInSwitch on: "small" runs on into "large".
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": [],
    "noFallthroughCasesInSwitch": true
  },
  "include": [
    "*.js"
  ]
}
main.js TypeScript 5.9.3 TypeScript 5.9.3, run 21 October 2026: No errors. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. No errors. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. No errors. checked 21 October 2026
/** @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;
}
noFallthroughCasesInSwitch off: small coffee costs 450.
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, throw or continue does not fall through, so it is not reported.

Sources

Last reviewed 20 October 2026.