-
Notifications
You must be signed in to change notification settings - Fork 889
New rule: no-default-export #1182
Comments
If nobody is interesting in taking this one, I would love to get this in the code base today. |
go for it @patsissons! |
relevant to those on this thread: #2117 |
I'm not really convinced by the arguments here. Typically when using import fizzBuzz from "./fizzBuzz"
// or depending on convention in the project
import fizzBuzz from "./fizz-buzz" Following that convention you'll never hit a case where the semantic meaning of a name is different from the |
but we don't have a lint rule to enforce that :) |
This is not a issue for a typeless ES6, it should not be a issue for TS. |
Sorry for necro-posting. I found this rule to be very useful to enforce one style of exporting things (especially classes) across an app. |
In my experience,
default
exports are not a great practice, especially anonymous ones. I think you should always name the things you are exporting. Also, default exports allow for subtle mistakes after refactoring. With default exports, you could change the semantics of a component but it might be imported elsewhere with a name suggesting its old semantic meaning.The text was updated successfully, but these errors were encountered: