This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -6,22 +6,23 @@ import ruleURI from 'eslint-rule-documentation'
6
6
export default class Rules {
7
7
/**
8
8
* Instantiates a Rules object, optionally with an existing list of rules
9
- * @param {Array<Array<string, any> } newRules Array of Arrays of the rule and properties
9
+ * @param {Array<Array<string, any> | undefined } newRules Array of Arrays of the rule and properties
10
10
*/
11
11
constructor ( newRules ) {
12
+ // TODO we should not accept undefined newRules.
12
13
this . replaceRules ( newRules )
13
14
}
14
15
15
16
/**
16
17
* Process the updated rules into the local Map and call further update functions
17
- * @param {Array<Array<string, any> } newRules Array of Arrays of the rule and properties
18
+ * @param {Array<Array<string, any> | undefined } newRules Array of Arrays of the rule and properties
18
19
*/
19
20
replaceRules ( newRules ) {
20
21
if ( this . rules !== undefined ) {
21
22
this . rules . clear ( )
22
23
}
23
24
24
- /** @type {Map<string, any> } */
25
+ /** @type {Map<string, any> } if newRules is {undefined} an empty Map is created */
25
26
this . rules = new Map ( newRules )
26
27
}
27
28
You can’t perform that action at this time.
0 commit comments