christopheradams / elixir_style_guide

A community driven style guide for Elixir
4.37k stars 299 forks source link

Switch the order of 'require' and 'alias' #199

Closed TBK145 closed 3 years ago

TBK145 commented 3 years ago

By switching the order of require and alias it forces you to write the full module when requiring. This makes it more explicit which module is required.

christopheradams commented 3 years ago

Thanks @TBK145. I tend to agree with your reasoning. We've discussed the position of alias in the past but not require as far as I remember.

I'd appreciate hearing any counter-arguments though.

There's an issue in the PR: since you changed the module attributes order list, you also have to update the example module below to reflect the changes.

christopheradams commented 3 years ago

I'd like to accept this change as it supports the same conclusion of #141 to keep aliases themselves from being used in module directives.