jshint ignore Use '!==' to compare with ''

前端 未结 2 657
滥情空心
滥情空心 2021-02-07 23:43

How can I configure JSHint to ignore this error: Use \'!==\' to compare with \'\'. ?

I want that this code pass:

/*jshint undef: false */
if         


        
相关标签:
2条回答
  • 2021-02-08 00:07

    The solution is to install the new version of jshint:

    npm install -g https://github.com/jshint/jshint/archive/1.0.0-rc4.tar.gz

    Then to use this config:

    {
        "-W041": false
    }
    

    Finally this command

    jshint --config jshint.json file.js

    0 讨论(0)
  • 2021-02-08 00:18

    Just use:

    if (a) {
    
    }
    

    You don't ever need to use == true in a if statement.

    0 讨论(0)
提交回复
热议问题