JSLint error: Move all 'var' declarations to the top of the function

后端 未结 7 1070
栀梦
栀梦 2020-11-30 05:16

JSLint site updated, and I cannot check JS scripts anymore. For me, this warning is not critical, and I don\'t want to go through thousands of lines to fix this, I want to f

7条回答
  •  抹茶落季
    2020-11-30 05:49

    Even though the new beta JSLint doesn't document a comment directive for multiple var tolerance within a function, it does appear to support the directives from the original version.

    The original JSLint allowed you to do this:

    /*jslint vars: true */
    

    In my experience this still works—I suppose for backwards compatibility. The time of this writing is June 2015.

提交回复
热议问题