Rules
no-dangerously-set-innerhtml
Full Name in eslint-plugin-react-dom
Full Name in @eslint-react/eslint-plugin
Presets
dom
recommended
recommended-typescript
recommended-type-checked
Description
Disallow 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 usingchildren
anddangerouslySetInnerHTML
at the same time.no-void-elements-with-children
Prevents the use ofchildren
in void DOM elements.