An indent hook automatically adds whitespace, so it seems prudent to add the hook to remove unwanted whitespace again. This is what we do in most languages already.
Loosely based on sh.kak and c-family.kak. See https://elv.sh for information on the Elvish language. In particular, see https://elv.sh/ref/language.html for the language syntax and https://elv.sh/ref/builtin.html for builtin commands.