常用解决eslint和格式化冲突问题(vue)

2023-05-16

.eslintrc.js文件修改

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    'plugin:vue/essential',
    '@vue/standard'
  ],
  parserOptions: {
    parser: 'babel-eslint'
  },
  rules: {
    // allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-trailing-spaces': 'off',
indent: 'off',
'spaced-comment': 'off',
'no-trailing-spaces': 'off',
'no-new': 'off',
'key-spacing': 'off',
'comma-dangle': 'off',
'eol-last': 'off',
quotes: 'off',
semi: 'off',
'keyword-spacing': 'off',
'space-before-blocks': 'off',
'comma-spacing': 'off',
'space-before-function-paren': 'off',
'space-infix-ops': 'off',
'no-multiple-empty-lines': 'off',
'block-spacing': 'off',
'padded-blocks': 'off',
'arrow-spacing': 'off',
'no-sequences': 'off',
'no-unused-expressions': 'off',
'no-multi-spaces': 'off',
'no-unused-vars': 'off',
'camelcase ': 'off',
  }
}

再创建.prettierrc文件即可

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

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

常用解决eslint和格式化冲突问题(vue) 的相关文章

随机推荐