source: frontend/node_modules/eslint-plugin-import/docs/rules/no-amd.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 977 bytes
Line 
1# import/no-amd
2
3<!-- end auto-generated rule header -->
4
5Reports `require([array], ...)` and `define([array], ...)` function calls at the
6module scope. Will not report if !=2 arguments, or first argument is not a literal array.
7
8Intended for temporary use when migrating to pure ES6 modules.
9
10## Rule Details
11
12This will be reported:
13
14```js
15define(["a", "b"], function (a, b) { /* ... */ })
16
17require(["b", "c"], function (b, c) { /* ... */ })
18```
19
20CommonJS `require` is still valid.
21
22## When Not To Use It
23
24If you don't mind mixing module systems (sometimes this is useful), you probably
25don't want this rule.
26
27It is also fairly noisy if you have a larger codebase that is being transitioned
28from AMD to ES6 modules.
29
30## Contributors
31
32Special thanks to @xjamundx for donating his no-define rule as a start to this.
33
34## Further Reading
35
36 - [`no-commonjs`](./no-commonjs.md): report CommonJS `require` and `exports`
37 - Source: <https://github.com/xjamundx/eslint-plugin-modules>
Note: See TracBrowser for help on using the repository browser.