简体   繁体   English

当 Eslint 解析 Tsx/Ts 文件 'public' 令牌时,总是显示 'Parsing error: Unexpected token'

[英]When Eslint parse Tsx/Ts file 'public' token, always shows 'Parsing error: Unexpected token'

i am using eslint and react, while writing public token in tsx/ts file, always show me public is unexpected token..我正在使用 eslint 并做出反应,在 tsx/ts 文件中写入公共令牌时,总是告诉我公共是意外令牌..

在此处输入图像描述

在此处输入图像描述

it shows error because i use babel-eslint ...just change my eslint parser to @typescript-eslint/parser ...它显示错误,因为我使用babel-eslint ...只需将我的 eslint 解析器更改为@typescript-eslint/parser ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ESLint:解析错误:意外的令牌: - ESLint: Parsing error: Unexpected token : nextjs webpack typescript (.ts, .tsx) 模块解析失败:意外令牌 (6:7) - nextjs webpack typescript (.ts, .tsx) Module parse failed: Unexpected token (6:7) 如何修复解析错误:index.tsx 中的意外标记,预期“,”? - How to fix Parsing error: Unexpected token, expected "," in index.tsx? webpack tsx 模块解析失败:意外令牌 - webpack tsx Module parse failed: Unexpected token 当 Webpack ts-loader 显示“模块解析失败:意外令牌”时,tsconfig.json jsx 被保留 - tsconfig.json jsx is preserve when Webpack ts-loader shows "Module parse failed: Unexpected token" ESlint 在 TypeScript 转换运算符“as”上解析错误“意外标记” - ESlint parsing error "Unexpected token" on TypeScript cast operator "as" 错误 TS5014:无法解析文件“tsconfig.json”:位置 57 处的意外令牌/JSON - error TS5014: Failed to parse file 'tsconfig.json': Unexpected token / in JSON at position 57 从 ts 文件导出多个 typescript 类型别名时出现“意外令牌”错误 - Error “ Unexpected token” when export multiple typescript type alias from a ts file 语法错误:意外令牌{在执行TS应用时 - Syntax error: Unexpected token { on executing a TS app 配置 ESLint 解析.ts 和 .tsx 为 Typescript 和.js 和.jsx 为 Ecmascript - Configure ESLint to parse .ts and .tsx as Typescript and .js and .jsx as Ecmascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM