TIL there are autoformatters for shell! https://github.com/patrickvane/shfmt
I try really hard to not write shell scripts over 100 lines and port to Python (for e.g. type checking and better linting) when I can. I can definitely see myself using shfmt though.