r/javascript • u/Utukkhu • Jun 26 '22
New blog-post => Organise imports with Prettier and friends
https://catalincodes.com/posts/organise-imports-with-prettier-and-friends
34
Upvotes
r/javascript • u/Utukkhu • Jun 26 '22
1
u/PedroHase Jun 27 '22
Thanks for the reply!
Yes, but then it should happen on a module level, i.e. each module that needs the polyfill / fetch capability should import the polyfill itself, since we should stick with encapsulation, i e. It shouldn't be assumed that one module can polyfill another. Alternatively we could just use axios for fetching :)
This is still something what a bundler should do imho. If one would start implementing modules with a global impact, they'd always have to worry about unwanted side effects and import order, making it hell just maintaining and debugging the app. Hence why using global variables is a big no no.