Open
Description
Apparently, since 2.9.1, unreachable code is allowed by default, you have to explicitly set allowUnreachableCode
to false
in tsconfig.json
to get the old behavior.
This doesn't match what's described in the docs.
Quick repro :
package.json
{
"name": "tmp",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"typescript": "2.9.1"
}
}
tsconfig.json (default from tsc --init)
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"strict": true,
"esModuleInterop": true
}
}
index.ts
export const a = (): boolean => {
return true;
return false;
};
yarn tsc
outputs no warning as of 2.9.1