-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
かっこ と スペースに関するルールの修正とオプションの追加 #127
かっこ と スペースに関するルールの修正とオプションの追加 #127
Conversation
かっこの内側または外側が日本語以外のとき、半角かっこをエラーにしない。 ただし、かっこ内に日本語が含まれる場合は全角かっこを必須とする。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます。
よさそうな気がします。(エラーとなるケースが増えるはずなのでmajor updateにする予定です)
オプションについてREADMEに足せるといいのですが、既存だと他にオプションがないのでQ&A欄にrequireOutsideHalfParenthesesの利用例を書くとかになる感じですかね
const requireOutsideHalfParentheses = | ||
options.requireOutsideHalfParentheses ?? defaultOptions.requireOutsideHalfParentheses; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultOptions.requireOutsideHalfParentheses
こちらってデフォルト値が未定義になっています?
明示的に入れた方がいいので、 defaultOptions.requireOutsideHalfParentheses を定義するのがよさそうですね
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメントありがとうございます。
すみません、こちらデフォルト値の定義が漏れていたため追加いたしました。
378d68f
to
b30b5ce
Compare
FAQ に 3.3 のオプションに関する設定例を追加してみました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ありがとうございます!
close #81
#81 の Proposal を実装しました。
次のように解釈しています。問題があればご指摘いただければと思います。
かっこの内側または外側が日本語以外のとき、例外的に半角かっこをエラーにしないようにしました。
ただし、かっこ内に 1 文字でも日本語が含まれている場合は全角かっこを必須としています。
自然さを考慮して半角スペースのみを許容しています。
#81 (comment) の通り、「かっこの外側が日本語の場合のみ外側のスペースを必須」としています。
また、テストの都合上
tool/create-fixtures.js
に options のサポートを追加しています。fixer-test では様々なオプションの組み合わせをテストするのは難しいと判断し、単純に
options
が指定されているテストケースは無視するように変更しました。