If you refactor Foo in foo.ts it will not rename it in bar.ts.
Yes it will if you use a sane IDE like VSCode
If you end up needing to export more stuff from foo.ts (which is what many of your files will have) then you have to juggle the import syntax.
Oh the horrors... it was a single variable, now it might be 2 or god... three.
If a module has default exports then I don't need IntelliSense, it's a single damn module
You don't get typos like one dev doing import Foo from "./foo"; and another doing import foo from "./foo";
So yeah, that takes a few second to discover. I doubt that this is a problem since you start with the import and using the imported variable will come from the autocomplete.
Keep using defaults folks when it makes sense, like a module only contains a single class / object / variable.
Your comment doesn't make much of a case for defaults, other than characterising the objections as whining. I am curious to know why some people prefer them. I am aware of the airbnb decision but I am not completely convinced. In fact, I don't understand why they added this quirky and seemingly unnecessary extra to the specification.
2
u/kowdermesiter Aug 27 '18
Yes it will if you use a sane IDE like VSCode
Oh the horrors... it was a single variable, now it might be 2 or god... three.
If a module has default exports then I don't need IntelliSense, it's a single damn module
So yeah, that takes a few second to discover. I doubt that this is a problem since you start with the import and using the imported variable will come from the autocomplete.
Keep using defaults folks when it makes sense, like a module only contains a single class / object / variable.