56 lines
986 B
Plaintext
56 lines
986 B
Plaintext
:language: javascript
|
|
|
|
include::../rule.adoc[]
|
|
|
|
=== Exceptions
|
|
|
|
The rule ignores constructors where parameters are *all* parameter properties:
|
|
|
|
[source,javascript]
|
|
----
|
|
class C {
|
|
constructor(
|
|
private param1: number,
|
|
private param2: boolean,
|
|
private param3: string,
|
|
private param4: string[],
|
|
private param5: number | string
|
|
) {} // Compliant by exception
|
|
}
|
|
----
|
|
|
|
The rule also ignores Angular component constructors:
|
|
|
|
[source,javascript]
|
|
----
|
|
import { Component } from '@angular/core';
|
|
|
|
@Component({/* ... */})
|
|
class Component {
|
|
constructor(p1, p2, p3, p4, p5) {} // Compliant by exception
|
|
}
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
* Key: max
|
|
** Description: Maximum authorized number of parameters
|
|
** Default Value: 7
|
|
|
|
|
|
include::../parameters.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|