# prefer-cypress-should

Rule `sonarjs/prefer-cypress-should`. Cypress assertions should be retryable

- Source: sonarjs
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1341 by reach, #642 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/prefer-cypress-should` | yes | suggestion | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-9162/) |

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/prefer-cypress-should": "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/post-message](https://lintradar.dev/rules/sonarjs/post-message.md): Origins should be verified during cross-origin communications
- [sonarjs/prefer-default-last](https://lintradar.dev/rules/sonarjs/prefer-default-last.md): "default" clauses should be last
- [sonarjs/parameterized-tests](https://lintradar.dev/rules/sonarjs/parameterized-tests.md): Similar tests should be grouped in a single Parameterized test
- [sonarjs/prefer-native-axios-alternative](https://lintradar.dev/rules/sonarjs/prefer-native-axios-alternative.md): Native APIs should be preferred over Axios utility methods
- [sonarjs/object-alt-content](https://lintradar.dev/rules/sonarjs/object-alt-content.md): "<object>" tags should provide an alternative content
- [sonarjs/prefer-native-jquery-alternative](https://lintradar.dev/rules/sonarjs/prefer-native-jquery-alternative.md): Native APIs should be preferred over jQuery utility methods

---

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