source: frontend/node_modules/eslint-plugin-import/docs/rules/no-default-export.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: 1.2 KB
Line 
1# import/no-default-export
2
3<!-- end auto-generated rule header -->
4
5Prohibit default exports. Mostly an inverse of [`prefer-default-export`].
6
7[`prefer-default-export`]: ./prefer-default-export.md
8
9## Rule Details
10
11The following patterns are considered warnings:
12
13```javascript
14// bad1.js
15
16// There is a default export.
17export const foo = 'foo';
18const bar = 'bar';
19export default 'bar';
20```
21
22```javascript
23// bad2.js
24
25// There is a default export.
26const foo = 'foo';
27export { foo as default }
28```
29
30The following patterns are not warnings:
31
32```javascript
33// good1.js
34
35// There is only a single module export and it's a named export.
36export const foo = 'foo';
37```
38
39```javascript
40// good2.js
41
42// There is more than one named export in the module.
43export const foo = 'foo';
44export const bar = 'bar';
45```
46
47```javascript
48// good3.js
49
50// There is more than one named export in the module
51const foo = 'foo';
52const bar = 'bar';
53export { foo, bar }
54```
55
56```javascript
57// export-star.js
58
59// Any batch export will disable this rule. The remote module is not inspected.
60export * from './other-module'
61```
62
63## When Not To Use It
64
65If you don't care if default imports are used, or if you prefer default imports over named imports.
Note: See TracBrowser for help on using the repository browser.