乐趣区

关于vue.js:eslint格式化vue文件配置可格式化html和css部分

.eslintrc.js

module.exports = {
  root: true,
  env: {node: true},
  extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/prettier'],
  parserOptions: {parser: 'babel-eslint'},
  plugins: ['prettier'],
  rules: {.....}
}

须要的依赖

"@vue/eslint-config-prettier": "^6.0.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "^1.19.1",
"prettier-eslint": "^11.0.0",
退出移动版