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

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

Fix frontend appearance

  • Property mode set to 100644
File size: 998 bytes
Line 
1# import/export
2
3💼 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`.
4
5<!-- end auto-generated rule header -->
6
7Reports funny business with exports, like repeated exports of names or defaults.
8
9## Rule Details
10
11```js
12export default class MyClass { /*...*/ } // Multiple default exports.
13
14function makeClass() { return new MyClass(...arguments) }
15
16export default makeClass // Multiple default exports.
17```
18
19or
20
21```js
22export const foo = function () { /*...*/ } // Multiple exports of name 'foo'.
23
24function bar() { /*...*/ }
25export { bar as foo } // Multiple exports of name 'foo'.
26```
27
28In the case of named/default re-export, all `n` re-exports will be reported,
29as at least `n-1` of them are clearly mistakes, but it is not clear which one
30(if any) is intended. Could be the result of copy/paste, code duplication with
31intent to rename, etc.
32
33## Further Reading
34
35 - Lee Byron's [ES7] export proposal
36
37[ES7]: https://github.com/leebyron/ecmascript-more-export-from
Note: See TracBrowser for help on using the repository browser.