When working on front-end projects I always like to work with linting tools. They prevent from dumb mistakes to serious smelly code pieces. Linting tools also suggest improv
There are no W3C HTML validators for JSX. JSX is JS, not HTML. So you can use eslint plugins for linting jsx to avoid common problems:
Does it exist W3C HTML validators for React JSX files?
No.
In case it does not, any reason for it?
Because they aren't HTML.
The closest you could come would be to execute the JavaScript to generate a DOM, then serialize that DOM to HTML (e.g. with .innerHTML
), and then add a DOCTYPE declaration and validate the result.
This, of course, only gives you a snapshot of the output for a given state of the application.
Server-side rendering tools (such as Next.js) are probably helpful here.