src/content/docs/linter/rules/no-void.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/complexity/noVoid`](/reference/diagnostics#diagnostic-category) - This rule isn't recommended, so you need to enable it. - This rule doesn't have a fix. - The default severity of this rule is [**warning**](/reference/diagnostics#warning). - Sources: - Same as [`no-void`](https://eslint.org/docs/latest/rules/no-void){
"linter": {
"rules": {
"complexity": {
"noVoid": "error"
}
}
}
}
Disallow the use of void operators, which is not a familiar operator.
The
voidoperator is often used merely to obtain the undefined primitive value, usually usingvoid(0)(which is equivalent tovoid 0). In these cases, the global variableundefinedcan be used.
void 0;