Ban unreachable code. (#104521)

This changes unreachable code from a warning presented in the editor to an error. Existing issues mostly revolved around switching on enums. These were fixed by converting the switches to use a default case, leaving the behavior unchanged in case of new values (e.g. from separately-compiled extensions) creeping in.

Other cases had to do with the assert.fail() function, which throws and so shouldn't have anything following it.

Co-authored-by: Maksym Taran <maksym.taran@gmail.com>
This commit is contained in:
mtaran-google
2020-08-17 14:38:32 -07:00
committed by GitHub
parent 4cee5da307
commit 76bc88fd9d
17 changed files with 41 additions and 44 deletions

View File

@@ -5,6 +5,7 @@
"experimentalDecorators": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"allowUnreachableCode": false,
"strict": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",