项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

39 line
1023 B

  1. /**
  2. * @fileoverview Rule to disallow use of void operator.
  3. * @author Mike Sidorov
  4. */
  5. "use strict";
  6. //------------------------------------------------------------------------------
  7. // Rule Definition
  8. //------------------------------------------------------------------------------
  9. module.exports = {
  10. meta: {
  11. docs: {
  12. description: "disallow `void` operators",
  13. category: "Best Practices",
  14. recommended: false,
  15. url: "https://eslint.org/docs/rules/no-void"
  16. },
  17. schema: []
  18. },
  19. create(context) {
  20. //--------------------------------------------------------------------------
  21. // Public
  22. //--------------------------------------------------------------------------
  23. return {
  24. UnaryExpression(node) {
  25. if (node.operator === "void") {
  26. context.report({ node, message: "Expected 'undefined' and instead saw 'void'." });
  27. }
  28. }
  29. };
  30. }
  31. };