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'
66export default class Rules {
77 /**
88 * 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
1010 */
1111 constructor ( newRules ) {
12+ // TODO we should not accept undefined newRules.
1213 this . replaceRules ( newRules )
1314 }
1415
1516 /**
1617 * 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
1819 */
1920 replaceRules ( newRules ) {
2021 if ( this . rules !== undefined ) {
2122 this . rules . clear ( )
2223 }
2324
24- /** @type {Map<string, any> } */
25+ /** @type {Map<string, any> } if newRules is {undefined} an empty Map is created */
2526 this . rules = new Map ( newRules )
2627 }
2728
You can’t perform that action at this time.
0 commit comments