How to Solve Eslint syntax error in Vue project

“And” in the project; Errors are often reported. It’s really tangled. Today I see a solution that can be deleted without uninstallation

In the project root directory, create a new. Pretierrc file to remove semicolons and replace with single quotes

{
   "semi": false,
   "singleQuote": true
}

In this way, the format will not change to “”

You can also disable the syntax rules and modify the. Eslintrc.js file to disable the error items

module.exports = {
  root: true,
  env: {
    node: true
  },
  'extends': [
    'plugin:vue/essential',
    '@vue/standard'
  ],
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ?'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ?'error' : 'off',
    'space-before-function-paren': 0 //Disable this rule
  },
  parserOptions: {
    parser: 'babel-eslint'
  }
}

 

Similar Posts: