Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 693 Bytes

react-no-dangerous-html.md

File metadata and controls

26 lines (17 loc) · 693 Bytes

Pattern: Use of React's dangerouslySetInnerHTML

Issue: -

Description

This rule finds usages of React's dangerouslySetInnerHTML. One should not use this API because it possible opens your system up to an XSS attack.

Suppressions

Suppressions can be specified in your tslint.json configuration file like this:

"react-no-dangerous-html": [true, 
    { 
        "file": "local/path/to/MyFile.ts", 
        "method": "render", 
        "comment": "Usage has been approved by our Security Group on 2015-03-12"
    }
]

Further Reading