no-dynamic-import.js 769 B

123456789101112131415161718192021222324252627282930
  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 `import()` syntax",
  10. category: "ES2020",
  11. recommended: false,
  12. url:
  13. "http://mysticatea.github.io/eslint-plugin-es/rules/no-dynamic-import.html",
  14. },
  15. fixable: null,
  16. messages: {
  17. forbidden: "ES2020 'import()' syntax is forbidden.",
  18. },
  19. schema: [],
  20. type: "problem",
  21. },
  22. create(context) {
  23. return {
  24. ImportExpression(node) {
  25. context.report({ messageId: "forbidden", node })
  26. },
  27. }
  28. },
  29. }