Breaking Change: デフォルトでは文末の"です/である"のみ検出するように #14
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
strict
オプションを導入し、デフォルトを{ "strict": false }
としています。そのため、デフォルトでは文末の表記のみを対象にチェックするように変更されています。
textlintでは多くのルールはfalse positiveにならないように、デフォルトを緩く設定しています。
厳しく(接続的な"である"なども)検出したい場合は、
{ "strict": true }
オプションが利用できます。例えば、
strict:false
(デフォルト)では以下のような"である場合に"という接続的な"である"は無視されます。そのため、次のような "であったが" は無視されています。
strict:false
では次のような文末が"である"や"です"といったものだけを検出します。そのため、次の文章は"ですが"と"である"が混在しているのでエラーとなります。
strict:true
としていた場合では、以下の文章は"ですが"と"である"が混在しているのでエラーとなります。Q. なぜデフォルトでは文末のみの検出なのですか?
A. 自然言語に絶対の表現がないためデフォルトを緩くするためです。
Q. 2.0(以前)と同じ挙動にするにはどうすればよいですか?
A. オプションに
"strict": true
を追加してください。2.0
3.0
関連Issue
close #13