Eslint: How to disable “unexpected console statement” in Node.js?

后端 未结 17 1613
遇见更好的自我
遇见更好的自我 2020-12-07 07:39

I\'m using eslint with Sublime Text 3 and I am writing gulpfile.js.

/*eslint-env node*/
var gulp = require(\'gulp\');

gulp.task(\'default\', fu         


        
17条回答
  •  Happy的楠姐
    2020-12-07 08:06

    The following works with ESLint in VSCode if you want to disable the rule for just one line.

    To disable the next line:

    // eslint-disable-next-line no-console
    console.log('hello world');
    

    To disable the current line:

    console.log('hello world'); // eslint-disable-line no-console
    

提交回复
热议问题