# call-argument-line

Rule `sonarjs/call-argument-line`. Function call arguments should not start on new lines

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
var fn = function () {
  //...
}

(function () { // Noncompliant
  //...
})();
```

### Correct: the rule accepts this

```js
// define a function
var fn = function () {
  //...
}; // <-- semicolon added

// then execute some code inside a closure
(function () {
  //...
})();
```

```js
var fn = function () {
  //...
}(function () { // <-- start function call arguments on same line
  //...
})();
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/call-argument-line": "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/block-scoped-var](https://lintradar.dev/rules/sonarjs/block-scoped-var.md): Variables should be used in the blocks where they are declared
- [sonarjs/chai-determinate-assertion](https://lintradar.dev/rules/sonarjs/chai-determinate-assertion.md): Chai assertions should have only one reason to succeed
- [sonarjs/bitwise-operators](https://lintradar.dev/rules/sonarjs/bitwise-operators.md): Bitwise operators should not be used in boolean contexts
- [sonarjs/class-name](https://lintradar.dev/rules/sonarjs/class-name.md): Class names should comply with a naming convention
- [sonarjs/aws-sqs-unencrypted-queue](https://lintradar.dev/rules/sonarjs/aws-sqs-unencrypted-queue.md): SQS queues should be encrypted
- [sonarjs/code-eval](https://lintradar.dev/rules/sonarjs/code-eval.md): Dynamic code execution should not use user-controlled data

---

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