[英]Unexpected token, expected "," Eslint Typescript with Vue
I was getting this eslint error when trying to use vue's type assertion.尝试使用 vue 的类型断言时出现此 eslint 错误。 here's an example:这是一个例子:
data: function () {
return {
sellerIdToListings: {} as any, // 'as' Unexpected token, expected ","
}
},
I started putting packages that didn't come with vue-cli 1 by 1 until I realized the problem was with babel-eslint .我开始一个一个地放置 vue-cli 没有附带的包,直到我意识到问题出在 babel-eslint 上。 After removing it from package-json and unparse it from eslintrc the problem was solved从 package-json 中删除它并从 eslintrc 中解析它后,问题就解决了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.