文末の句点(。)の統一 OR 抜けをチェックするtextlintルール
OK: これは問題ない文章です。
NG: これは問題ある文章です
パラグラフの末尾に必ず句点記号を付けていることをチェックするルールです。
Install with npm:
npm install textlint-rule-ja-no-mixed-period
Via .textlintrc
(Recommended)
{
"rules": {
"ja-no-mixed-period": true
}
}
Via CLI
textlint --rule ja-no-mixed-period README.md
OK:
これは問題ないです。
末尾に感嘆符はある!
「これはセリフ」
english only
- 箇条書きは無視される
NG:
これは句点がありません
末尾にスペースがある。
絵文字が末尾にある。😆
periodMark
: string
:
allowPeriodMarks
: string[]
periodMark
に指定したものは自動的に許可リストに加わる[]
allowEmojiAtEnd
: boolean
false
forceAppendPeriod
: boolean
periodMark
を--fix時に追加するかどうかfalse
checkFootnote
: boolean
false
{
"rules": {
"ja-no-mixed-period": {
// 優先する句点文字
"periodMark": "。",
// 句点文字として許可する文字列の配列
"allowPeriodMarks": [],
// 末尾に絵文字を置くことを許可するか
"allowEmojiAtEnd": false,
// 句点で終わって無い場合に`periodMark`を--fix時に追加するかどうか
"forceAppendPeriod": false
}
}
}
会話文/疑問文
末尾に。
がない場合でも、代わりに感嘆符や疑問符、括弧などがある場合は例外として扱います。
これは問題ない文章ですか!?
「会話文は括弧で括れば末尾に。がなくても問題ありません」
箇条書き
箇条書きの中はチェックせず無視します。
- これは問題ないです
- これも問題ないです
箇条書き間の。
の有無の統一については次のルールを参照してください。
日本語ではない
日本語が含まれていないパラグラフは無視します。
See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu