eslint配置

全局安装eslint
看控制台输出什么错
报的错千奇百怪的,不过百度后很好解决,下面附上我的eslint配置
{
“editor.tabSize”: 2,

"prettier.singleQuote": true,
"prettier.semi": false, //分号结尾
  "prettier.useTabs": true,
  "prettier.vueIndentScriptAndStyle": true, // 视区宽度 换行
  "prettier.arrowParens": "avoid", //  (x) => {} 箭头函数参数只有一个是否要有小括号。avoid:省略括号


"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.defaultFormatterOptions": {
  "js-beautify-html": {
    // force-aligned | force-expand-multiline
    "wrap_attributes": "force-aligned" // - auto: 仅在超出行长度时才对属性进行换行。 // - force: 对除第一个属性外的其他每个属性进行换行。 // - force-aligned: 对除第一个属性外的其他每个属性进行换行,并保持对齐。 // - force-expand-multiline: 对每个属性进行换行。 // - aligned-multiple: 当超出折行长度时,将属性进行垂直对齐。
  },
  "prettyhtml": {
    "printWidth": 100,
    "singleQuote": false,
    "wrapAttributes": true,
    "sortAttributes": true
  },
  "prettier": {
    "semi": false,
    "singleQuote": true
  }
},
"emmet.syntaxProfiles": {
  "vue-html": "html",
  "vue": "html"
},
"vetur.validation.template": false,
"eslint.options": {
  "plugins": ["html"]
},
"eslint.nodePath": "D:\\Program Files\\nodejs\\node_global\\node_modules",
"eslint.validate": ["javascript", "javascriptreact", "vue", "html"],
"explorer.confirmDelete": false,

"editor.codeActionsOnSave": {
  "source.fixAll.eslint": true
},
"[jsonc]": {
  "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
  "editor.defaultFormatter": "octref.vetur"
},
"[javascript]": {
  "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
  "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
  "editor.defaultFormatter": "esbenp.prettier-vscode"
},


"git.suggestSmartCommit": false,

// "workbench.colorTheme": "SynthWave '84",
// "workbench.preferredDarkColorTheme": "SynthWave '84",
// "workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 1.2,
// "workbench.startupEditor": "newUntitledFile"

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值