no-async-functions.js 774 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @author Toru Nagashima <https://github.com/mysticatea>
  3. * See LICENSE file in root directory for full license.
  4. */
  5. "use strict"
  6. module.exports = {
  7. meta: {
  8. docs: {
  9. description: "disallow async function declarations.",
  10. category: "ES2017",
  11. recommended: false,
  12. url:
  13. "http://mysticatea.github.io/eslint-plugin-es/rules/no-async-functions.html",
  14. },
  15. fixable: null,
  16. schema: [],
  17. messages: {
  18. forbidden: "ES2017 async function declarations are forbidden.",
  19. },
  20. },
  21. create(context) {
  22. return {
  23. ":function[async=true]"(node) {
  24. context.report({ node, messageId: "forbidden" })
  25. },
  26. }
  27. },
  28. }