Skip to content

Commit b8f52a9

Browse files
committedJun 6, 2016
Fix parameters when using reset
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.
1 parent d562d6e commit b8f52a9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎lib/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function attachFactory(id, rule, options) {
121121
rule(ast, file, options, done);
122122
}
123123

124-
return options === false ? null : plugin;
124+
return plugin;
125125
}
126126

127127
return attach;
@@ -267,7 +267,13 @@ function lint(remark, options) {
267267
known.push(id);
268268

269269
if (!(setting === null || setting === undefined)) {
270+
/* Pass turned on rules `undefined`. */
271+
if (reset && setting === true) {
272+
setting = undefined;
273+
}
274+
270275
if (setting === false) {
276+
setting = undefined;
271277
disable.push(id);
272278
} else {
273279
enable.push(id);

0 commit comments

Comments
 (0)
Please sign in to comment.