Turning off eslint rule for a specific file

后端 未结 15 1488
后悔当初
后悔当初 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 17:40

    You can turn off/change a particular rule for a file by putting the configurations at the top of the file.

    /* eslint no-use-before-define: 0 */  // --> OFF
    
    or
    
    /* eslint no-use-before-define: 2 */  // --> ON
    

    More info

提交回复
热议问题