src/content/docs/linter/rules/no-label-var.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/suspicious/noLabelVar`](/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-label-var`](https://eslint.org/docs/latest/rules/no-label-var){
"linter": {
"rules": {
"suspicious": {
"noLabelVar": "error"
}
}
}
}
Disallow labels that share a name with a variable
const x1 = "test";
x1: expr;
const x = "test";
z: expr;