Przejdź do głównej zawartości

noVoid

Ta treść nie jest jeszcze dostępna w Twoim języku.

biome.json
{
"linter": {
"rules": {
"complexity": {
"noVoid": "error"
}
}
}
}

Disallow the use of void operators, which is not a familiar operator.

The void operator is often used merely to obtain the undefined primitive value, usually using void(0) (which is equivalent to void 0). In these cases, the global variable undefined can be used.

void 0;
code-block.js:1:1 lint/complexity/noVoid ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The use of void is not allowed.

> 1 │ void 0;
^^^^^^
2 │

If you use void to alter the return type of a function or return undefined, use the global undefined instead.