no-continue.js 879 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * @fileoverview Rule to flag use of continue statement
  3. * @author Borislav Zhivkov
  4. */
  5. "use strict";
  6. //------------------------------------------------------------------------------
  7. // Rule Definition
  8. //------------------------------------------------------------------------------
  9. /** @type {import('../shared/types').Rule} */
  10. module.exports = {
  11. meta: {
  12. type: "suggestion",
  13. docs: {
  14. description: "Disallow `continue` statements",
  15. recommended: false,
  16. url: "https://eslint.org/docs/rules/no-continue"
  17. },
  18. schema: [],
  19. messages: {
  20. unexpected: "Unexpected use of continue statement."
  21. }
  22. },
  23. create(context) {
  24. return {
  25. ContinueStatement(node) {
  26. context.report({ node, messageId: "unexpected" });
  27. }
  28. };
  29. }
  30. };