56 lines
874 B
Plaintext
56 lines
874 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
With a maximum number of 4 parameters:
|
|
|
|
[source,javascript]
|
|
----
|
|
function doSomething(param1, param2, param3, param4, param5) {
|
|
...
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
[source,javascript]
|
|
----
|
|
function doSomething(param1, param2, param3, param4) {
|
|
...
|
|
}
|
|
----
|
|
|
|
== Exceptions
|
|
|
|
The rule ignores constructors where parameters are *all* parameter properties:
|
|
|
|
[source,javascript]
|
|
----
|
|
class C {
|
|
constructor(
|
|
param1: number,
|
|
param2: boolean,
|
|
param3: string,
|
|
param4: string[],
|
|
param5: number | string
|
|
) {}
|
|
}
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::message.adoc[]
|
|
|
|
include::../parameters.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|