AFAIK, there's no pre-flight syntax checker for shell, and there's no way it could know what you want your vars called...
what is very useful for debugging is adding this as the next line after the shebang line
This shows the 'before & after' versions of each line as it is processed; very informative.
The other tip is to write small sections of code & then test them individually (eg using that cmd), don't try to write an entire script in one go.