iamturns / eslint-config-airbnb-typescript

Airbnb's ESLint config with TypeScript support
MIT License
1.05k stars 98 forks source link

`no-unreachable` should not be disabled #347

Open benj-dobs opened 6 months ago

benj-dobs commented 6 months ago

The TypeScript compiler only enforces this check if explicitly configured to do so: https://www.typescriptlang.org/tsconfig#allowUnreachableCode

(Default behaviour is just to surface an editor warning.)

no-unreachable is disabled here:

https://github.com/iamturns/eslint-config-airbnb-typescript/blob/766a2b975055bd827b72cbb538643e9103c1bdd4/lib/shared.js#L282

I think it would be more in-keeping with the spirit of this config to leave it enabled, rather than requiring users to have allowUnreachableCode: false in their tsconfig file to achieve the same behaviour.

benj-dobs commented 6 months ago

I've raised an issue for the ESLint docs too: https://github.com/eslint/eslint/issues/18378