# no-mutate-reactive-state-in-updated-hook

Rule `sonarjs/no-mutate-reactive-state-in-updated-hook`. Reactive state should not be unconditionally mutated inside Vue's "updated" lifecycle hook

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/no-mutate-reactive-state-in-updated-hook` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-9163/) |

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/no-mutate-reactive-state-in-updated-hook": "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/no-misleading-character-class](https://lintradar.dev/rules/sonarjs/no-misleading-character-class.md): Unicode Grapheme Clusters should be avoided inside regex character classes
- [sonarjs/no-nested-assignment](https://lintradar.dev/rules/sonarjs/no-nested-assignment.md): Assignments should not be made from within sub-expressions
- [sonarjs/no-misleading-array-reverse](https://lintradar.dev/rules/sonarjs/no-misleading-array-reverse.md): Array-mutating methods should not be used misleadingly
- [sonarjs/no-nested-conditional](https://lintradar.dev/rules/sonarjs/no-nested-conditional.md): Ternary operators should not be nested
- [sonarjs/no-mime-sniff](https://lintradar.dev/rules/sonarjs/no-mime-sniff.md): Browsers should not be allowed to perform MIME type sniffing
- [sonarjs/no-nested-functions](https://lintradar.dev/rules/sonarjs/no-nested-functions.md): Functions should not be nested too deeply

---

Web page: https://lintradar.dev/rules/sonarjs/no-mutate-reactive-state-in-updated-hook. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
