# no-redundant-jump

Rule `sonarjs/no-redundant-jump`. Jump statements should not be redundant

- 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: #1308 by reach, #609 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/no-redundant-jump` | yes | suggestion | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-3626/) |

## Code examples

### Incorrect: the rule reports this

```js
function redundantJump(x) {
  if (x == 1) {
    console.log("x == 1");
    return; // Noncompliant
  }
}
```

### Correct: the rule accepts this

```js
function redundantJump(x) {
  if (x == 1) {
    console.log("x == 1");
  }
}
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/no-redundant-jump": "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-redundant-boolean](https://lintradar.dev/rules/sonarjs/no-redundant-boolean.md): Boolean literals should not be used in comparisons
- [sonarjs/no-redundant-optional](https://lintradar.dev/rules/sonarjs/no-redundant-optional.md): Optional properties should not redundantly include 'undefined'
- [sonarjs/no-redundant-assignments](https://lintradar.dev/rules/sonarjs/no-redundant-assignments.md): Assignments should not be redundant
- [sonarjs/no-referrer-policy](https://lintradar.dev/rules/sonarjs/no-referrer-policy.md): HTTP Referrer-Policy should not be set to an unsafe value
- [sonarjs/no-primitive-wrappers](https://lintradar.dev/rules/sonarjs/no-primitive-wrappers.md): Wrapper objects should not be used for primitive types
- [sonarjs/no-regex-spaces](https://lintradar.dev/rules/sonarjs/no-regex-spaces.md): Regular expressions should not contain multiple spaces

---

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