简体   繁体   English

意外的令牌,预期的“,” Eslint Typescript with Vue

[英]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.

相关问题 打字稿错误意外的令牌,预期为“}” - Typescript error Unexpected token, expected “}” ESlint 在 TypeScript 转换运算符“as”上解析错误“意外标记” - ESlint parsing error "Unexpected token" on TypeScript cast operator "as" React typescript eslint 错误解析错误:意外的令牌? 如何解决这个问题? - React typescript eslint error Parsing error: Unexpected token ! How to fix this? 意外令牌:Vue Typescript 文件中的(冒号) - Unexpected Token : (colon) in Vue Typescript file 解析错误:意外的令牌,预期的“,” - 与 Typescript 反应 - Parsing error: Unexpected token, expected “,” - React with Typescript 反应 Typescript 组件意外令牌,预期“{” - React Typescript Component Unexpected token, expected "{" ReactJs TypeScript:语法错误:意外令牌,预期; - ReactJs TypeScript : Syntax error: Unexpected token, expected ; Webpack 4, babel 7, react, typescript: Unexpected token, expected "," - Webpack 4, babel 7, react, typescript: Unexpected token, expected "," ESLint:解析错误:意外的令牌: - ESLint: Parsing error: Unexpected token : 将 Typescript 添加到 ReactJS 项目时,catch 块上出现“意外令牌,预期“)”? - 'Unexpected token, expected ")"' on catch block when adding Typescript to ReactJS project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM