Skip to content

Commit

Permalink
Revise return types
Browse files Browse the repository at this point in the history
  • Loading branch information
softius committed Aug 3, 2024
1 parent 0c3d9a4 commit 4fea00e
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions designs/2024-baseline-support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ To introduce the above-mentioned options, we will need to:
* add the new options as comments and arguments for eslint.
* update documentation to explain the newly introduced feature.

A new type must be created:
A new type must be created to represent the suppressions file:

``` js
/**
* @typedef {Record<string, { count: number }>} SuppressedViolation
* @typedef {Record<string, Record<string, { count: number }>} SuppressedViolations
*/
```

Expand All @@ -154,21 +154,22 @@ class SuppressedViolationsManager {
* Updates the suppressions file based on the current violations.
*
* @param {LintResult[]} results The lint results.
* @returns {LintResult[]}
* @returns {void}
*/
suppressAll(results)

/**
* Updates the suppressions file based on the current violations and the provided rule
* Updates the suppressions file based on the current violations and the provided rule.
*
* @param {LintResult[]} results The lint results.
* @param {string} rule The rule to suppress.
* @returns {void}
*/
suppressByRule(results, rule)

/**
* Removes old suppressions that do not occur anymore.
* @returns void
* @returns {void}
*/
prune()

Expand All @@ -178,27 +179,27 @@ class SuppressedViolationsManager {
* It also returns the unmatched suppressions.
*
* @param {LintResult[]} results The lint results.
* @param {SuppressedViolation[]} suppressions The suppressions.
* @return {
* @param {SuppressedViolations} suppressions The suppressions.
* @returns {{
* results: LintResult[],
* unmatched: SuppressedViolation[]
* }
* unmatched: SuppressedViolations
* }}
*/
applySuppressions(results, suppressions)

/**
* Loads the suppressions file.
* @returns SuppressedViolation[]
* @returns {SuppressedViolations}
*/
load()

/**
* Updates the suppressions file.
* @param {SuppressedViolation[]}
* @returns void
* @param {SuppressedViolations} suppressions The suppressions to save.
* @returns {void}
* @private
*/
save()
save(suppressions)
}
```

Expand Down

0 comments on commit 4fea00e

Please sign in to comment.