# dompurify-unsafe-config

Rule `sonarjs/dompurify-unsafe-config`. DOMPurify configuration should not be bypassable

- Source: sonarjs
- Technologies: JavaScript
- Kind: correctness
- Needs type information: yes
- Autofix: no
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1206 by reach, #507 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/dompurify-unsafe-config` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-8479/) |

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/dompurify-unsafe-config": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [SonarJS recommended](https://lintradar.dev/presets/sonarjs-recommended.md) | ESLint | `eslint-plugin-sonarjs` | 230 | 6.2M | +62.1% |

## Related rules

- [sonarjs/disabled-timeout](https://lintradar.dev/rules/sonarjs/disabled-timeout.md): Disabling Mocha timeouts should be explicit
- [sonarjs/duplicates-in-character-class](https://lintradar.dev/rules/sonarjs/duplicates-in-character-class.md): Character classes in regular expressions should not contain the same character twice
- [sonarjs/disabled-resource-integrity](https://lintradar.dev/rules/sonarjs/disabled-resource-integrity.md): Remote artifacts should not be used without integrity checks
- [sonarjs/dynamically-constructed-templates](https://lintradar.dev/rules/sonarjs/dynamically-constructed-templates.md): Templates should not be constructed dynamically
- [sonarjs/disabled-auto-escaping](https://lintradar.dev/rules/sonarjs/disabled-auto-escaping.md): Auto-escaping in HTML template engines should not be disabled
- [sonarjs/empty-string-repetition](https://lintradar.dev/rules/sonarjs/empty-string-repetition.md): Repeated patterns in regular expressions should not match the empty string

---

Web page: https://lintradar.dev/rules/sonarjs/dompurify-unsafe-config. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
