2023-05-03 11:06:20 +02:00
== Why is this an issue?
2021-06-08 14:23:48 +02:00
Shared coding conventions allow teams to collaborate effectively. This rule raises an issue when the use of spaces in a rest parameter or with a spread operator does not conform to the configured requirements.
2023-05-03 11:06:20 +02:00
=== Noncompliant code example
2021-06-08 14:23:48 +02:00
With the configured default forbidding parentheses:
2022-02-04 17:28:24 +01:00
[source,javascript]
2021-06-08 14:23:48 +02:00
----
function cPrint(... args) { // Noncompliant
console.log(args);
}
function foo(a, b, c) {
}
const arr = [10, 20];
foo(... arr, 30); // Noncompliant
----
2023-05-03 11:06:20 +02:00
=== Compliant solution
2021-06-08 14:23:48 +02:00
2022-02-04 17:28:24 +01:00
[source,javascript]
2021-06-08 14:23:48 +02:00
----
function cPrint(...args) {
console.log(args);
}
function foo(a, b, c) {
}
const arr = [10, 20];
foo(...arr, 30);
----