reactjs - ข้อผิดพลาดในการวิเคราะห์: DeprecationError: 'originalKeywordKind' ถูกเลิกใช้ตั้งแต่ v5.0.0 และไม่สามารถใช้งานได้อีกต่อไป
เมื่อทำการอัปเกรดโปรเจกต์ React ที่มีอยู่ ฉันได้รับข้อผิดพลาดดังต่อไปนี้ที่บรรทัด 0 ของทุกไฟล์ .tsx
Parsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used. Use 'identifierToKeywordKind(identifier)' instead.
ฉันสามารถวินิจฉัยและลบข้อผิดพลาดได้อย่างไร?
คำตอบ #1
หลังจากอัปเดตไลบรารีแล้ว:
@typescript-eslint/eslint-plugin
@typescript-eslint/parser
ไปยังเวอร์ชัน 6.x แก้ปัญหาแล้ว
ดู https://github.com/typescript-eslint/typescript-eslint/issues/7155#issuecomment-1692384149 สำหรับรายละเอียดเพิ่มเติม
คำตอบ #2
มันถูกแก้ไขแล้วเมื่อฉันอัปเดตแพ็กเกจ eslint typescript ของฉัน "@typescript-eslint/eslint-plugin": "^6.x", "@typescript-eslint/parser": "^6.x",
npm install @typescript-eslint/eslint-plugin --save-dev
npm install @typescript-eslint/parser --save-dev
คำตอบ #3
สำหรับฉัน การเริ่มเซิร์ฟเวอร์ ESLint ใหม่ใน VSCode ใช้ได้เลย!
กด ctrl+shift + p => Restart ESLint Server
คำตอบ #4
สำหรับฉัน การลดเวอร์ชันของ TypeScript และ ESLint ใช้ได้ผล
typescript: 5.1.6 eslint: 8.47.0

