There are a few tools that are an absolute must for writing decent code. Keep these close.
ShellCheck #
ShellCheck is a tool written in haskell and available through most package managers. You use it as you would use most linters:
shellcheck shellscript.shshfmt #
shfmt formats shell programs. This helps keeping your code uniform in the same format.
My usual use:
shfmt -i 2 -w scripts.sh