Dead Code (ARCH3188)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key typescript.quality.dead-code · Severity info · Category quality
Code following a return, throw, break, or continue statement never executes. Unreachable code misleads the reader and adds maintenance burden; it should be removed.
Incorrect
Section titled “Incorrect”function getRole(user: User): string { return user.isAdmin ? "admin" : "user"; console.log("done"); // unreachable}Correct
Section titled “Correct”function getRole(user: User): string { console.log("done"); return user.isAdmin ? "admin" : "user";}Remove unreachable statements or fix the control flow so they actually run.