-
Notifications
You must be signed in to change notification settings - Fork 1
import/no-default-export #39
Comments
a fourth option would be to enable it here as an arror but disable it again in the repos which cannot be turned easily to named export. |
That’s just Option 2 - the breaking change ... |
What's the downside of default exports? I personally haven't seen any downsides to it. |
That is true storybook requires default export. We can enable it for |
to get a consistent style throughout all repositories.
https://humanwhocodes.com/blog/2019/01/stop-using-default-exports-javascript-module/
If we need to, we can make an exception for stories. |
Also, I might be mistaken, so correct me if I'm wrong, but I think that if you directly export an anonymous function react component as default export, like this:
the component will show up with the name
but at that point, why not just do:
|
code splitting also requires default exports, but we are not actively doing this (at the moment), and there are also workarounds. The handbook also mentions that we don't want default exports, so I think |
Issue moved to pmedianetwork/adverity-frontend-monorepo #1237 via ZenHub |
PR #63
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-default-export.md
We should turn on that rule. In some repos (
presense-frontend
,design-system
), we could easily adapt that rule. Ininsights
andadverity-components
, it is rather difficult. We have 3 options now:warning
, and lint the repos where we already have no default exports with--max-warnings=0
, which basically makes warning to errors@namjul @vlabs @danielbartsch
See also: https://github.com/pmedianetwork/handbook/issues/13
The text was updated successfully, but these errors were encountered: