babel-plugin-validate-jsx-nesting
Babel plugin to validate JSX nesting at compile time
When browsers encounter invalid nesting like <hr> inside <p>, they silently fix the DOM structure - causing mismatches between your JSX and the actual DOM.
Markup
Browser modifies it to this:
This babel plugin catches these errors at compile time:
Setup
Install the babel-plugin-validate-jsx-nesting package and add it to the plugins section of your babel configuration file.
Use warnOnly to log warnings instead of failing the build.