Skip to content

Commit

Permalink
feat(rule): add 典型例
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Mar 26, 2017
1 parent 070747c commit c484a31
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ textlint --rule ja-unnatural-alphabet README.md

- `allow`: `string[]`
- 無視するアルファベットの配列
- デフォルト: `["a", "i", "u", "e", "o", "n", "/[a-zA-Za-zA-Z]言語/"]`
- デフォルト: `["a", "i", "u", "e", "o", "n", 典型例 ]`
- デフォルトでは母音とnを除外している
- `"/正規表現/" のような文字列もサポート

Expand Down
9 changes: 8 additions & 1 deletion src/textlint-rule-ja-unnatural-alphabet.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ const defaultOptions = {
// 無視するアルファベット
// 例) ["X"]
// デフォルトでは母音とnと典型例を除外している
"allow": ["a", "i", "u", "e", "o", "n", "/[a-zA-Za-zA-Z]言語/"]
"allow": [
"a", "i", "u", "e", "o",
"n",
"/[a-zA-Za-zA-Z]言語/",
"/[x-zX-Z]座標/",
"/[x-zX-Z]軸/",
"Eメール"
]
};
const report = (context, options = {}) => {
const { Syntax, RuleError, report, getSource } = context;
Expand Down
3 changes: 3 additions & 0 deletions test/textlint-rule-ja-unnatural-alphabet-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ tester.run("textlint-rule-ja-unnatural-alphabet", rule, {
"This is pen.",
"これはC言語",
"これはD言語",
"これはX座標",
"これはX軸",
"これはEメール",
{
text: "アンドロイドNは良し",
options: {
Expand Down

0 comments on commit c484a31

Please sign in to comment.