Skip to content

Commit

Permalink
Fix parameters when using reset
Browse files Browse the repository at this point in the history
Previously, `true` was passed when in `reset: true` mode and a rule
was turned on by passing `true` as well.  Now, `undefined` is passed
instead.
  • Loading branch information
wooorm committed Jun 6, 2016
1 parent d562d6e commit b8f52a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function attachFactory(id, rule, options) {
rule(ast, file, options, done);
}

return options === false ? null : plugin;
return plugin;
}

return attach;
Expand Down Expand Up @@ -267,7 +267,13 @@ function lint(remark, options) {
known.push(id);

if (!(setting === null || setting === undefined)) {
/* Pass turned on rules `undefined`. */
if (reset && setting === true) {
setting = undefined;
}

if (setting === false) {
setting = undefined;
disable.push(id);
} else {
enable.push(id);
Expand Down

0 comments on commit b8f52a9

Please sign in to comment.