解决vue的eslint代码规范中,因function前少一个空格的问题

解决vue的eslint代码规范中,因function前少一个空格的问题

如下问题

http://eslint.org/docs/rules/space-before-function-paren Missing space before function parentheses
src/components/login/login.vue:16:10
mounted() {
}

解决办法

找到根目录下的.eslintrc.js文件,在 rules中添加:
"space-before-function-paren": 0
如下所示:

 rules: {
    'generator-star-spacing': 'off',
    "space-before-function-paren": 0,
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
  }

猜你喜欢

转载自blog.csdn.net/weixin_41767649/article/details/90115453