Parse imports in file body (and move them to the top)
I've another idea. What about elm-format understanding import definitions in the middle of the file? Since files in elm can be long, I'm jumping a lot between writing functions and the top of the file to import modules. If elm-format would understand e.g. import Date somewhere in the file, and move it automatically to the top (and to all it's merge magic), one could benefit a lot and reduce file jumping.
Is this possible? Would this work out? Due to import being a keyword, the differentiation between it and other code should be possible and robust. What do you think about this one @avh4 ?
Yep, I've been thinking about this too. I've only really thought about allowing it as a top-level declaration, (meaning imports could only be allowed in between top-level definitions, and not just anywhere in the middle of expressions). I think that could be added safely (even if import weren't a keyword).
Sounds awesome. Imports inline would be weird. Top level definitions are fine.