Lessons learned from writing a linter/static analysis tool for shell scripts: https://www.vidarholen.net/contents/blog/?p=859
(Preserve positions, use error codes and document them, and there's a tradeoff between beginner mistakes and advanced mistakes!)
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.