The void operator evaluates an expression and returns undefined, regardless of the expression’s value.
While this was historically used to safely obtain undefined, modern JavaScript has undefined as a proper value, making the void operator unnecessary and potentially confusing.
void 0 is specifically used in minified code to lower total character size, but that is not necessary in source code.
Using undefined directly is clearer and more explicit.
If you have a specific code style that requires the use of void operator, you might want to disable this rule.
However, in most modern codebases, using undefined directly is preferred for clarity.