Turning off eslint rule for a specific file

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

    To disable a specific rule for the file:

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

    Note there is a bug in eslint where single line comment will not work -

    // eslint-disable max-classes-per-file
    // This fails!
    

    Check this post

提交回复
热议问题