# composite-assertions

Rule `sonarjs/composite-assertions`. Composite assertions should be split

- Source: sonarjs
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2125 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/composite-assertions` | no | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-9073/) |

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/composite-assertions": "error",
    },
  },
];
```

## Related rules

- [sonarjs/comment-regex](https://lintradar.dev/rules/sonarjs/comment-regex.md): Track comments matching a regular expression
- [sonarjs/class-prototype](https://lintradar.dev/rules/sonarjs/class-prototype.md): Class methods should be used instead of "prototype" assignments
- [sonarjs/bool-param-default](https://lintradar.dev/rules/sonarjs/bool-param-default.md): Optional boolean parameters should have default value
- [sonarjs/cyclomatic-complexity](https://lintradar.dev/rules/sonarjs/cyclomatic-complexity.md): Cyclomatic Complexity of functions should not be too high
- [sonarjs/aws-iam-all-resources-accessible](https://lintradar.dev/rules/sonarjs/aws-iam-all-resources-accessible.md): IAM policies should not grant access to all account resources
- [sonarjs/declarations-in-global-scope](https://lintradar.dev/rules/sonarjs/declarations-in-global-scope.md): Variables and functions should not be declared in the global scope

---

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