Hi,
Indeed it's difficult to find documentation and books between the low level stuff like the old flex/bison and high level tools like Xtext or even MPS.
For your use case I think you could simply write a set of eslint rules. This short document is a good start https://gist.github.com/sindresorhus/1656c46f23545deff8cc713...
https://astexplorer.net is recommended and a good resource.