If you use eslint and tell it how to run lint in CLAUDE.md it will run lint itself and find and fix most issues like this.
Definitely not ideal, but sure helps.