2 * @fileoverview Rule to disallow use of void operator.
7 //------------------------------------------------------------------------------
9 //------------------------------------------------------------------------------
16 description: "disallow `void` operators",
17 category: "Best Practices",
19 url: "https://eslint.org/docs/rules/no-void"
23 noVoid: "Expected 'undefined' and instead saw 'void'."
35 additionalProperties: false
41 const allowAsStatement =
42 context.options[0] && context.options[0].allowAsStatement;
44 //--------------------------------------------------------------------------
46 //--------------------------------------------------------------------------
49 'UnaryExpression[operator="void"]'(node) {
53 node.parent.type === "ExpressionStatement"