[no-unreachable] Recommended rule disabled with default TS compiler options #1041
Labels
documentation
Documentation ("docs") that needs adding/updating
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Recommended ESLint rules that are already handled by TypeScript are turned off in
plugin:@typescript-eslint/recommended
.The
no-unreachable
rule is one of the disabled rules because it is covered by the TypeScript compiler errorTS7027
. However this TS error is suppressed by default since2.9.1
.This means that when using the recommended rules without explicitly turning off the
allowUnreachableCode
flag, no ESLint or TS errors will alert the developer of the presence of unreachable code.I am not sure what the best approach to this is, but it may be worth considering not disabling
no-unreachable
in the recommended rules or adding a note in the docs...Repro
From the ESLint docs:
Expected Result
To be alerted of the unreachable code.
Actual Result
No error reported with the default TypeScript compiler options.
Versions
@typescript-eslint/eslint-plugin
2.3.0
@typescript-eslint/parser
2.3.0
TypeScript
3.6.3
ESLint
6.4.0
node
10.16.3
npm
6.9.0
The text was updated successfully, but these errors were encountered: