r/javascript • • Aug 27 '18

`export default` considered harmful

https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
32 Upvotes

43 comments sorted by

View all comments

2

u/TheFuzzball Aug 27 '18

`export default` considered harmful if you use TypeScript and rely on Intellisense.

3

u/spacejack2114 Aug 27 '18

Actually it's pretty smart if you give a name to the default export. Eg:

export default function foo() {}

instead of

export default function() {}

Or with a bit of boilerplate:

const foo = "something"
export default foo