Skip to content

Commit 1a29c9b

Browse files
committed
fix(rule): fix to work "allow" option
close #1
1 parent d721ace commit 1a29c9b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/textlint-rule-alex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function textlintRuleAlex(context, options = {}) {
3535
return;
3636
}
3737
const text = getSource(node);
38-
const messages = alex.text(text, allowWords).messages;
38+
const messages = alex(text, allowWords).messages;
3939
messages.forEach((result) => {
4040
reportError(node, result);
4141
});

test/textlint-rule-alex-test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ var tester = new TextLintTester();
88
tester.run("alex", rule, {
99
valid: [
1010
"This is a pen",
11-
"男女"
11+
"男女",
12+
{
13+
text: "The boogeyman",
14+
options: {
15+
allow: ["boogeyman-boogeywoman"]
16+
}
17+
}
1218
],
1319
invalid: [
1420
{

0 commit comments

Comments
 (0)