-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allowSyntheticDefaultImports
is too opinionated
#2382
Comments
Hey @ngthanhtrung thanks for raising this, I completely agree with you. I didn't even know that config got turned on must of been missed along the way. Happy to change this and get it deployed on the next release. Its only a few config files changes i think 16 to be exact. I can make these change this weekend when i get a chance as i have another change i want to make with the typing's. I have just seen that it is actually turned off in
Sorry to hear that Cheers for the feedback on this really appreciate it 👍 |
Thanks a bunch, @joshstevens19, will work on a PR now so you don't have to bother with implementing this. |
Ok yes thanks that would be great, please reference this issue on the PR 👍 |
Hey @joshstevens19 is there anywhere to chat with you outside of GitHub? I got some questions to ask. |
Telegram - @joshstevens19 👍 |
Will close as PR is up and will be merged. |
Expected behavior
allowSyntheticDefaultImports
should be turned off since this is a very opinionated rule. When it's turned on like what we have right now, other projects which depend onweb3
have to obey the rule no matter what.This is bad since some projects (and I personally) prefer non-synthetic default imports, they are easier to reason in term of understanding what's happened behind the scene. Namespace imports and default imports have different meanings and they raise different awareness on what to expect when importing a module.
Since the typings have been added into
web3
, a lot of packages got broken because the new typings are not compatible with@types/web3
(which is good enough typing package in my opinion, except some minor missing typings).I think a package like
web3
shouldn't dictate on how imports should be made. I understand the ease and consistency of using default imports all the time but it only makes sense on an application level, not a library level like whatweb3
should be.Actual behavior
allowSyntheticDefaultImports
is turned on in alltsconfig.json
, which makes all dependent projects have to follow this rule against their will.@joshstevens19 tagging you here for discussion. I'd be happy to make a PR to fix.
The text was updated successfully, but these errors were encountered: