wangmm
V2EX  ›  问与答

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

  •  
  •   wangmm · Nov 23, 2017 · 7889 views
    This topic created in 3121 days ago, the information mentioned may be changed or developed.
    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 replies    2017-11-23 18:03:32 +08:00
    QAPTEAWH
        1
    QAPTEAWH  
       Nov 23, 2017
    alt-回车(mac 键位),有没有 disable inspection?
    wangmm
        2
    wangmm  
    OP
       Nov 23, 2017
    @QAPTEAWH 没有
    pocketkids
        3
    pocketkids  
       Nov 23, 2017   ❤️ 1
    Settings -> Editor -> Inspections -> JavaScript -> Probable bugs -> Equality operator may cause type coercion
    FrankFang128
        4
    FrankFang128  
       Nov 23, 2017
    意思是 == 是个 BUG,请用 ===
    JS 就是这么坑
    FrankFang128
        5
    FrankFang128  
       Nov 23, 2017
    == 都是跟新人用的,老手都会避开 ==
    wangmm
        6
    wangmm  
    OP
       Nov 23, 2017
    @pocketkids 感谢 完美解决
    wangmm
        7
    wangmm  
    OP
       Nov 23, 2017
    @FrankFang128 我才上班 这些都是别人写的 然后也就跟着用了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1248 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 17:27 · PVG 01:27 · LAX 10:27 · JFK 13:27
    ♥ Do have faith in what you're doing.