The ShellCheck tool is a linter for shell script, designed to find bugs and trouble spots in various flavors of shell scripts, including Bash. It identifies many of the common errors discussed in this book, and many more besides. It is available as both an online service and a command-line tool at https://www.shellcheck.net/.
The output of ShellCheck points you directly to trouble spots in your code, including error codes for reference with its online documentation: