
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
76 lines
1.2 KiB
Plaintext
76 lines
1.2 KiB
Plaintext
== Why is this an issue?
|
|
|
|
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(
|
|
private param1: number,
|
|
private param2: boolean,
|
|
private param3: string,
|
|
private param4: string[],
|
|
private param5: number | string
|
|
) {}
|
|
}
|
|
----
|
|
|
|
The rule also ignores Angular component constructors:
|
|
|
|
[source,javascript]
|
|
----
|
|
import { Component } from '@angular/core';
|
|
|
|
@Component({/* ... */})
|
|
class Component {
|
|
constructor(p1, p2, p3, p4, p5) {}
|
|
}
|
|
----
|
|
|
|
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[]
|