Skip to content

Files

Latest commit

 

History

History
23 lines (16 loc) · 492 Bytes

no-default-export.md

File metadata and controls

23 lines (16 loc) · 492 Bytes

Pattern: Use of default export

Issue: -

Description

Default exports can make refactoring and auto-imports less reliable since the name of the imported value can vary based on how it's imported. Named exports provide more explicit and predictable imports.

Examples

Example of incorrect code:

export default 'bar';

const foo = 'foo';
export { foo as default };

Example of correct code:

export const foo = "foo";
export const bar = "bar";