2023-08-10 16:54:47 +02:00
|
|
|
:language: javascript
|
2023-05-03 11:06:20 +02:00
|
|
|
|
2023-08-10 16:54:47 +02:00
|
|
|
include::../rule.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Exceptions
|
2022-09-15 11:46:29 +02:00
|
|
|
|
2023-08-18 14:01:14 +02:00
|
|
|
The rule ignores TypeScript parameter properties when counting parameters:
|
2022-09-15 11:46:29 +02:00
|
|
|
|
|
|
|
[source,javascript]
|
|
|
|
----
|
|
|
|
class C {
|
|
|
|
constructor(
|
2023-08-18 14:01:14 +02:00
|
|
|
private param1: number, // ignored
|
|
|
|
param2: boolean, // counted
|
|
|
|
public param3: string, // ignored
|
|
|
|
readonly param4: string[], // ignored
|
|
|
|
param5: number | string // counted
|
2023-08-10 16:54:47 +02:00
|
|
|
) {} // Compliant by exception
|
2022-09-15 11:46:29 +02:00
|
|
|
}
|
|
|
|
----
|
|
|
|
|
2022-09-29 11:12:03 +02:00
|
|
|
The rule also ignores Angular component constructors:
|
|
|
|
|
|
|
|
[source,javascript]
|
|
|
|
----
|
|
|
|
import { Component } from '@angular/core';
|
|
|
|
|
|
|
|
@Component({/* ... */})
|
|
|
|
class Component {
|
2023-08-10 16:54:47 +02:00
|
|
|
constructor(p1, p2, p3, p4, p5) {} // Compliant by exception
|
2022-09-29 11:12:03 +02:00
|
|
|
}
|
|
|
|
----
|
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
2023-05-25 14:18:12 +02:00
|
|
|
=== Message
|
|
|
|
|
|
|
|
* Key: max
|
|
|
|
** Description: Maximum authorized number of parameters
|
|
|
|
** Default Value: 7
|
|
|
|
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
include::../parameters.adoc[]
|
|
|
|
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2023-06-22 10:38:01 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|