diff --git a/lib/rules/validate-jsdoc.js b/lib/rules/validate-jsdoc.js index 381d299..db49170 100644 --- a/lib/rules/validate-jsdoc.js +++ b/lib/rules/validate-jsdoc.js @@ -20,7 +20,39 @@ module.exports.prototype = { * @param {Object} options * @throws {Error} If options is not an Object */ - configure: function(options) { + configure: function(options,config) { + + /** + * List of rules instances. + * + * @protected + * @type {Object} + */ + this._rules = {}; + + /** + * List of configurated rule instances. + * + * @protected + * @type {Object} + */ + this._ruleSettings = {}; + + Object.keys(config).forEach(function(key) { + + if (this._rules[key]) { + var optionValue = config[key]; + + // Disable rule if it equals "false" or "null" + if (optionValue === null || optionValue === false) { + delete this._ruleSettings[key]; + + } else { + this._ruleSettings[key] = config[key]; + } + + } + }, this); assert(typeof options === 'object', 'jsDoc option requires object value'); // rules structured by scopes-tags for jsdoc-tags