We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
undfeindの判定とかでよくif (!obj)などと書くと思います。 意外とjavascriptはfalsyな物が多く、例えばobj=""やobj=0でも!objがtrueになったりします。
if (!obj)
obj=""
obj=0
!obj
最近この挙動が原因で意図しない挙動が発生している事例をちょくちょく見かけたので、バグ防止のために利用不可にしたいです。
三項演算子の真偽値のとこにnumberをそのままいれて0のときの挙動が変わった例 #1832 (comment)
Recordのkey有無チェックのつもりがvalueが空文字で巻き込まれた例 https://github.com/VOICEVOX/voicevox/pull/1822/files#r1485653465
バグが減らせると思う
多少面倒になる・・・。
ESLintのstrict-boolean-expressionsの導入?
strict-boolean-expressions
The text was updated successfully, but these errors were encountered:
No branches or pull requests
内容
undfeindの判定とかでよく
if (!obj)
などと書くと思います。意外とjavascriptはfalsyな物が多く、例えば
obj=""
やobj=0
でも!obj
がtrueになったりします。最近この挙動が原因で意図しない挙動が発生している事例をちょくちょく見かけたので、バグ防止のために利用不可にしたいです。
三項演算子の真偽値のとこにnumberをそのままいれて0のときの挙動が変わった例
#1832 (comment)
Recordのkey有無チェックのつもりがvalueが空文字で巻き込まれた例
https://github.com/VOICEVOX/voicevox/pull/1822/files#r1485653465
Pros 良くなる点
バグが減らせると思う
Cons 悪くなる点
多少面倒になる・・・。
実現方法
ESLintの
strict-boolean-expressions
の導入?その他
The text was updated successfully, but these errors were encountered: