source: frontend/node_modules/eslint-plugin-import/docs/rules/no-named-default.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: 705 bytes
Line 
1# import/no-named-default
2
3<!-- end auto-generated rule header -->
4
5Reports use of a default export as a locally named import.
6
7Rationale: the syntax exists to import default exports expressively, let's use it.
8
9Note that type imports, as used by [Flow], are always ignored.
10
11[Flow]: https://flow.org/
12
13## Rule Details
14
15Given:
16
17```js
18// foo.js
19export default 'foo';
20export const bar = 'baz';
21```
22
23...these would be valid:
24
25```js
26import foo from './foo.js';
27import foo, { bar } from './foo.js';
28```
29
30...and these would be reported:
31
32```js
33// message: Using exported name 'bar' as identifier for default export.
34import { default as foo } from './foo.js';
35import { default as foo, bar } from './foo.js';
36```
Note: See TracBrowser for help on using the repository browser.