Turning off eslint rule for a specific file

后端 未结 15 1485
后悔当初
后悔当初 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:48

    Accepted answer didn't work for me (maybe a different version of eslint...? I'm using eslint v3.19.0), but did find a solution with the following...

    Place the following on the top of your file

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

    This will disable the rule for the entire file

提交回复
热议问题