Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion lib/rules/validate-jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down