grain
grain copied to clipboard
Formatter: Pun aliases when possible
There are many cases, such as include statements, where a user might add/refactor into an alias that's the same as the name of the thing they're aliasing, e.g. from "list" include List as List. It'd be good to have the formatter remove the redundant alias.
One thing to consider: a case like let foo = (param as param) => ... is a typechecking error, but formatting the code would make the error go away. We'll need to decide if this is something acceptable for the formatter to fix.