diff options
Diffstat (limited to 'tools/node_modules/eslint/lib/rules/no-void.js')
-rw-r--r-- | tools/node_modules/eslint/lib/rules/no-void.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/lib/rules/no-void.js b/tools/node_modules/eslint/lib/rules/no-void.js new file mode 100644 index 0000000000..5202fa49a8 --- /dev/null +++ b/tools/node_modules/eslint/lib/rules/no-void.js @@ -0,0 +1,37 @@ +/** + * @fileoverview Rule to disallow use of void operator. + * @author Mike Sidorov + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + docs: { + description: "disallow `void` operators", + category: "Best Practices", + recommended: false + }, + + schema: [] + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + UnaryExpression(node) { + if (node.operator === "void") { + context.report({ node, message: "Expected 'undefined' and instead saw 'void'." }); + } + } + }; + + } +}; |