Feature Request: Sorted Imports
I would love if there was an option to sort imports alphabetically. Liked groups could be segregated with a space (ex the way go fmt works).
mmmh not sure as the order of import does impact the bytecode generated and could potentially affect the way the state is stored and the amount of gas it uses on different calls.
doesn't feel right with me even as an option.
@fvictorio any thoughts?
@Janther Can you explain to me how import order impacts the bytecode? From my (albeit limited) experimenting, it seems to have no affect. Thanks!
I think I was mistaken, I was thinking of the order of inheritance in a contract. Still would like to hear the community's feedback on this one as it does change the parsed AST.
Parking this for now, it seems to add some complexity (specially if we add comments for the imports into the mix).
I am of the opinion that this kind of thing belongs in a linter (tagging @juanpcapurro, who is maintaining solhint-community).
That being said, not everyone agrees with that point of view. For example, rustfmt does sort imports (and a lot of other things).