45 lines
911 B
Plaintext
Raw 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 parentheses with an arrow function does not conform to the configured requirements.
=== Noncompliant code example
With the configured defaults forbidding parentheses
2022-02-04 17:28:24 +01:00
[source,javascript]
----
var foo = (a) => { /* ... */ }; // Noncompliant; remove parens from arg
var bar = (a, b) => { return 0; }; // Noncompliant; remove curly braces from body
----
=== Compliant solution
2022-02-04 17:28:24 +01:00
[source,javascript]
----
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[]