# no-extra-arguments

Rule `sonarjs/no-extra-arguments`. Function calls should not pass extra arguments

- 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: #1268 by reach, #569 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
function say(a, b) {
  print(a + " " + b);
}

say("hello", "world", "!"); // Noncompliant; last argument is not used
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/no-extra-arguments": "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-exclusive-tests](https://lintradar.dev/rules/sonarjs/no-exclusive-tests.md): Exclusive tests should not be committed to version control
- [sonarjs/no-fallthrough](https://lintradar.dev/rules/sonarjs/no-fallthrough.md): Switch cases should end with an unconditional "break" statement
- [sonarjs/no-equals-in-for-termination](https://lintradar.dev/rules/sonarjs/no-equals-in-for-termination.md): Equality operators should not be used in "for" loop termination conditions
- [sonarjs/no-fixed-wait-in-tests](https://lintradar.dev/rules/sonarjs/no-fixed-wait-in-tests.md): Fixed waits should not be used in tests
- [sonarjs/no-empty-test-title](https://lintradar.dev/rules/sonarjs/no-empty-test-title.md): Test and suite titles should not be empty or whitespace-only
- [sonarjs/no-floating-point-equality](https://lintradar.dev/rules/sonarjs/no-floating-point-equality.md): Floating point numbers should not be tested for equality

---

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