2022-02-04 16:28:24 +00:00

36 lines
668 B
Plaintext

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.
== Noncompliant Code Example
With the configured default forbidding parentheses:
[source,javascript]
----
function cPrint(... args) { // Noncompliant
console.log(args);
}
function foo(a, b, c) {
}
const arr = [10, 20];
foo(... arr, 30); // Noncompliant
----
== Compliant Solution
[source,javascript]
----
function cPrint(...args) {
console.log(args);
}
function foo(a, b, c) {
}
const arr = [10, 20];
foo(...arr, 30);
----