Solve Vuejs error error: Unexpected console statement (no-console)

Created in the root directory of the project
.eslintrc.jsfile and add the following code:

module.exports = {
    root: true,
    env: {
      node: true
    },
    'extends': [
      'plugin:vue/essential',
      'eslint:recommended'
    ],
    rules: {
      'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    //   'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
    },
    parserOptions: {
      parser: 'babel-eslint'
    }
}

as the picture shows:
Here Insert Picture Description

Published 10 original articles · won praise 9 · views 1105

Guess you like

Origin blog.csdn.net/weixin_42934172/article/details/104100989