# no-unused-function-argument

Rule `sonarjs/no-unused-function-argument`. Unused function parameters should be removed

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/no-unused-function-argument` | no | suggestion | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-1172/) |

## Code examples

### Incorrect: the rule reports this

```js
function doSomething(a, b) { // "a" is unused
  return compute(b);
}
```

### Correct: the rule accepts this

```js
function doSomething(b) {
  return compute(b);
}
```

```js
function doSomething(_a, b) {
  return compute(b);
}
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/no-unused-function-argument": "error",
    },
  },
];
```

## Related rules

- [sonarjs/no-variable-usage-before-declaration](https://lintradar.dev/rules/sonarjs/no-variable-usage-before-declaration.md): Variables declared with "var" should be declared before they are used
- [sonarjs/no-undefined-assignment](https://lintradar.dev/rules/sonarjs/no-undefined-assignment.md): "undefined" should not be assigned
- [sonarjs/no-wildcard-import](https://lintradar.dev/rules/sonarjs/no-wildcard-import.md): Wildcard imports should not be used
- [sonarjs/non-number-in-arithmetic-expression](https://lintradar.dev/rules/sonarjs/non-number-in-arithmetic-expression.md): Arithmetic operators should only have numbers as operands
- [sonarjs/no-sonar-comments](https://lintradar.dev/rules/sonarjs/no-sonar-comments.md): Track uses of "NOSONAR" comments
- [sonarjs/operation-returning-nan](https://lintradar.dev/rules/sonarjs/operation-returning-nan.md): Arithmetic operations should not result in "NaN"

---

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