38 lines
696 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
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:
2022-02-04 17:28:24 +01:00
[source,javascript]
----
function cPrint(... args) { // Noncompliant
console.log(args);
}
function foo(a, b, c) {
}
const arr = [10, 20];
foo(... arr, 30); // Noncompliant
----
=== Compliant solution
2022-02-04 17:28:24 +01:00
[source,javascript]
----
function cPrint(...args) {
console.log(args);
}
function foo(a, b, c) {
}
const arr = [10, 20];
foo(...arr, 30);
----