web 3d图形渲染器
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.

35 lines
932 B

  1. # import/no-amd
  2. Reports `require([array], ...)` and `define([array], ...)` function calls at the
  3. module scope. Will not report if !=2 arguments, or first argument is not a literal array.
  4. Intended for temporary use when migrating to pure ES6 modules.
  5. ## Rule Details
  6. This will be reported:
  7. ```js
  8. define(["a", "b"], function (a, b) { /* ... */ })
  9. require(["b", "c"], function (b, c) { /* ... */ })
  10. ```
  11. CommonJS `require` is still valid.
  12. ## When Not To Use It
  13. If you don't mind mixing module systems (sometimes this is useful), you probably
  14. don't want this rule.
  15. It is also fairly noisy if you have a larger codebase that is being transitioned
  16. from AMD to ES6 modules.
  17. ## Contributors
  18. Special thanks to @xjamundx for donating his no-define rule as a start to this.
  19. ## Further Reading
  20. - [`no-commonjs`](./no-commonjs.md): report CommonJS `require` and `exports`
  21. - Source: https://github.com/xjamundx/eslint-plugin-modules