react-no-danger
NOTE: this rule is included the following rule sets:
reactfreshEnable full set in
deno.json:{
"lint": {
"rules": {
"tags": ["react"] // ...or "fresh"
}
}
}Enable full set using the Deno CLI:
deno lint --rules-tags=react # or ... deno lint --rules-tags=fresh
Prevent the use of dangerouslySetInnerHTML which can lead to XSS
vulnerabilities if used incorrectly.
Invalid:
const hello = <div dangerouslySetInnerHTML={{ __html: "Hello World!" }} />;
Valid:
const hello = <div>Hello World!</div>;