41 lines
843 B
Plaintext
41 lines
843 B
Plaintext
Shared coding conventions allow teams to collaborate effectively. This rule raises an issue when the use of parentheses with an arrow function does not conform to the configured requirements.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
With the configured defaults forbidding parentheses
|
|
|
|
----
|
|
var foo = (a) => { /* ... */ }; // Noncompliant; remove parens from arg
|
|
var bar = (a, b) => { return 0; }; // Noncompliant; remove curly braces from body
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
var foo = a => { /* ... */ };
|
|
var bar = (a, b) => 0;
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::message.adoc[]
|
|
|
|
include::parameters.adoc[]
|
|
|
|
include::highlighting.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|