The top 10 is way too high level to be of any use, but the cheatsheets are actually not bad:
https://www.owasp.org/index.php/XSS_Prevention_Cheatsheet (end of the page)
Personally I think I'm too dumb to implement all that stuff by hand without screwing something up.