-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking Change: デフォルトでは文末の"です/である"のみ検出するように (#14)
`strict`オプションを導入し、デフォルトを`{ "strict": false }`としています。 そのため、デフォルトでは文末の表記のみを対象にチェックするように変更されています。 textlintでは多くのルールはfalse positiveにならないように、デフォルトを緩く設定しています。 厳しく(接続的な"である"なども)検出したい場合は、`{ "strict": true }` オプションが利用できます。 例えば、`strict:false`(デフォルト)では以下のような"である場合に"という接続的な"である"は無視されます。 そのため、次のような "であったが" は無視されています。 > OK: 昨日はいい天気であったが、今日は雨です。 `strict:false`では次のような文末が"である"や"です"といったものだけを検出します。 そのため、次の文章は"ですが"と"である"が混在しているのでエラーとなります。 > NG: 今日はいい天気である。明日も晴れです。 `strict:true`としていた場合では、以下の文章は"ですが"と"である"が混在しているのでエラーとなります。 > NG: 今日はいい天気ですが、明日は悪天候である。 ----- Q. なぜデフォルトでは文末のみの検出なのですか? A. 自然言語に絶対の表現がないためデフォルトを緩くするためです。 Q. 2.0(以前)と同じ挙動にするにはどうすればよいですか? A. オプションに`"strict": true`を追加してください。 2.0 ```js { "rules": { "no-mix-dearu-desumasu": { "preferInHeader": "", // "である" or "ですます" "preferInBody": "ですます",// "である" or "ですます" "preferInList": "である" // "である" or "ですます" } } } ``` 3.0 ```js { "rules": { "no-mix-dearu-desumasu": { "preferInHeader": "", // "である" or "ですます" "preferInBody": "ですます",// "である" or "ですます" "preferInList": "である", // "である" or "ですます" // 文末以外でも、敬体(ですます調)と常体(である調)を厳しくチェックするかどうか "strict": true } } } ``` 関連Issue - [接続的な "である" を無視するオプション · Issue #5 · azu/analyze-desumasu-dearu](textlint-ja/analyze-desumasu-dearu#5) - [Proposal: デフォルトでは文末の"です/である"のみ検出するように · Issue #13 · azu/textlint-rule-no-mix-dearu-desumasu](#13) close #13
- Loading branch information
Showing
5 changed files
with
178 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters