Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support disabling rules in jsdoc #175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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