|
Last change
on this file since 9af201e was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 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 |
|
|---|
| 5 | Reports `require([array], ...)` and `define([array], ...)` function calls at the
|
|---|
| 6 | module scope. Will not report if !=2 arguments, or first argument is not a literal array.
|
|---|
| 7 |
|
|---|
| 8 | Intended for temporary use when migrating to pure ES6 modules.
|
|---|
| 9 |
|
|---|
| 10 | ## Rule Details
|
|---|
| 11 |
|
|---|
| 12 | This will be reported:
|
|---|
| 13 |
|
|---|
| 14 | ```js
|
|---|
| 15 | define(["a", "b"], function (a, b) { /* ... */ })
|
|---|
| 16 |
|
|---|
| 17 | require(["b", "c"], function (b, c) { /* ... */ })
|
|---|
| 18 | ```
|
|---|
| 19 |
|
|---|
| 20 | CommonJS `require` is still valid.
|
|---|
| 21 |
|
|---|
| 22 | ## When Not To Use It
|
|---|
| 23 |
|
|---|
| 24 | If you don't mind mixing module systems (sometimes this is useful), you probably
|
|---|
| 25 | don't want this rule.
|
|---|
| 26 |
|
|---|
| 27 | It is also fairly noisy if you have a larger codebase that is being transitioned
|
|---|
| 28 | from AMD to ES6 modules.
|
|---|
| 29 |
|
|---|
| 30 | ## Contributors
|
|---|
| 31 |
|
|---|
| 32 | Special 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.