Modify rule S107: Do not count TypeScript parameter properties (#2898)

## Review

A dedicated reviewer checked the rule description successfully for:

- [ ] logical errors and incorrect information
- [ ] information gaps and missing content
- [ ] text style and tone
- [ ] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
This commit is contained in:
Yassin Kammoun 2023-08-18 14:01:14 +02:00 committed by GitHub
parent 9ce1a8de8e
commit 289a124d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,17 +4,17 @@ include::../rule.adoc[]
=== Exceptions
The rule ignores constructors where parameters are *all* parameter properties:
The rule ignores TypeScript parameter properties when counting parameters:
[source,javascript]
----
class C {
constructor(
private param1: number,
private param2: boolean,
private param3: string,
private param4: string[],
private param5: number | string
private param1: number, // ignored
param2: boolean, // counted
public param3: string, // ignored
readonly param4: string[], // ignored
param5: number | string // counted
) {} // Compliant by exception
}
----