src/content/docs/linter/rules/no-unreachable.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JavaScript (and super languages)" icon="seti:javascript"> ## Summary - Rule available since: `v1.0.0` - Diagnostic Category: [`lint/correctness/noUnreachable`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**error**](/reference/diagnostics#error). - Sources: - Same as [`no-unreachable`](https://eslint.org/docs/latest/rules/no-unreachable){
"linter": {
"rules": {
"correctness": {
"noUnreachable": "error"
}
}
}
}
Disallow unreachable code
function example() {
return;
neverCalled();
}
function example() {
for(let i = 0; i < 10; ++i) {
break;
}
}
function example() {
for(const key in value) {
continue;
neverCalled();
}
}