Recently having stumbled across the VSCode shellcheck plugin[1] - it's been particularly educational as it provides not only corrections but improvement tips. For example the common practice of:
if [ $? -ne 0 ]; then
Will get flagged and an improvement will be suggested with an explanation on why [2]