Rules
no-dangerously-set-innerhtml
Full Name in eslint-plugin-react-dom
Full Name in @eslint-react/eslint-plugin
Features
๐
Presets
domrecommendedrecommended-typescriptrecommended-type-checked
What it does
Warns when using dangerouslySetInnerHTML.
This should be used with extreme caution! If the HTML inside isnโt trusted (for example, if itโs based on user data), you risk introducing an XSS vulnerability.
Read more about using dangerouslySetInnerHTML.
Examples
Failing
Implementation
See Also
no-dangerously-set-innerhtml-with-children
Disallows DOM elements usingchildrenanddangerouslySetInnerHTMLat the same time.no-void-elements-with-children
Prevents the use ofchildrenin void DOM elements.