deno.com

react-no-danger

NOTE: this rule is included the following rule sets:reactfresh
Enable full set in deno.json:
{
  "lint": {
    "tags": ["react"] // ...or "fresh"
  }
}
Enable full set using the Deno CLI:
deno lint --tags=react
# or ...
deno lint --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>;

Did you find what you needed?

Privacy policy