怎么把 idea JS 文件中只要出现 == 就有黄色填充色给取消掉

2017-11-23 16:55:33 +08:00
 wangmm
This inspection reports usages of JavaScript equality operators which may cause unexpected type coercions. It is considered a good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.
Depending on the option selected, this will either highlight:
All usages of == and != operators.
All usages except comparison with null. Some code styles allow using x == null as a replacement for x === null || x === undefined.
Only suspicious expressions, such as: == or != comparisons to 0, '', null, true, false, or undefined.
6926 次点击
所在节点    问与答
8 条回复
QAPTEAWH
2017-11-23 17:17:06 +08:00
alt-回车(mac 键位),有没有 disable inspection?
wangmm
2017-11-23 17:19:56 +08:00
@QAPTEAWH 没有
pocketkids
2017-11-23 17:22:01 +08:00
Settings -> Editor -> Inspections -> JavaScript -> Probable bugs -> Equality operator may cause type coercion
FrankFang128
2017-11-23 17:22:10 +08:00
意思是 == 是个 BUG,请用 ===
JS 就是这么坑
FrankFang128
2017-11-23 17:22:30 +08:00
== 都是跟新人用的,老手都会避开 ==
wangmm
2017-11-23 17:51:07 +08:00
@pocketkids 感谢 完美解决
wangmm
2017-11-23 17:51:31 +08:00
@FrankFang128 我才上班 这些都是别人写的 然后也就跟着用了
SakuraSa
2017-11-23 18:03:32 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/408960

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX