V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
wangmm
V2EX  ›  问与答

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

  •  
  •   wangmm · 2017-11-23 16:55:33 +08:00 · 7094 次点击
    这是一个创建于 2565 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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.
    8 条回复    2017-11-23 18:03:32 +08:00
    QAPTEAWH
        1
    QAPTEAWH  
       2017-11-23 17:17:06 +08:00
    alt-回车(mac 键位),有没有 disable inspection?
    wangmm
        2
    wangmm  
    OP
       2017-11-23 17:19:56 +08:00
    @QAPTEAWH 没有
    pocketkids
        3
    pocketkids  
       2017-11-23 17:22:01 +08:00   ❤️ 1
    Settings -> Editor -> Inspections -> JavaScript -> Probable bugs -> Equality operator may cause type coercion
    FrankFang128
        4
    FrankFang128  
       2017-11-23 17:22:10 +08:00
    意思是 == 是个 BUG,请用 ===
    JS 就是这么坑
    FrankFang128
        5
    FrankFang128  
       2017-11-23 17:22:30 +08:00
    == 都是跟新人用的,老手都会避开 ==
    wangmm
        6
    wangmm  
    OP
       2017-11-23 17:51:07 +08:00
    @pocketkids 感谢 完美解决
    wangmm
        7
    wangmm  
    OP
       2017-11-23 17:51:31 +08:00
    @FrankFang128 我才上班 这些都是别人写的 然后也就跟着用了
    SakuraSa
        8
    SakuraSa  
       2017-11-23 18:03:32 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   869 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 21:16 · PVG 05:16 · LAX 13:16 · JFK 16:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.