Skip to content

Commit

Permalink
Improves the docs for allowUnreachableCode
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Jul 16, 2020
1 parent 2adacdd commit ea8407c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ display: "Allow Unreachable Code"
oneline: "Error when code will never be called"
---

Set to false to disable warnings about unreachable code.
When:

- `undefined` (default) provide suggestions as warnings to editors
- `true` unreachable code is ignored
- `false` raises compiler errors about unreachable code

These warnings are only about code which is provably unreachable due to the use of JavaScript syntax, for example:

```ts
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfig-reference/scripts/tsconfigRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const defaultsForOptions = {
allowJs: "false",
allowSyntheticDefaultImports: 'module === "system" or esModuleInterop',
allowUmdGlobalAccess: "false",
allowUnreachableCode: "false",
allowUnreachableCode: "undefined",
allowUnusedLabels: "false",
alwaysStrict: "`false`, unless `strict` is set",
charset: "utf8",
Expand Down

0 comments on commit ea8407c

Please sign in to comment.