Turning off eslint rule for a specific file

后端 未结 15 1489
后悔当初
后悔当初 2020-11-30 17:26

Is it possible to turn off the eslint rule for the whole file? Something such as:

// eslint-disable-file no-use-before-define 

(Analogous t

15条回答
  •  醉话见心
    2020-11-30 17:39

    As of today, the answer does not work for me, but putting this at the top of the file does work:

    /* eslint-disable @typescript-eslint/no-unused-vars */
    

    It is important to know that at least in my case, the type of comment makes a difference. The previous comment works for me, but the following won't work:

    // eslint-disable @typescript-eslint/no-unused-vars
    

提交回复
热议问题