microsoft / microsoft/TypeScript

JS files should parse as JS, not as JSX

Đang mở
#45,166 8 bình luận 0 reaction 1 người được giao Xem trên GitHub

@sandersn đang làm issue này rồi.

Từ ngày 26/7/2021.

Awaiting More Feedback Suggestion
Ngôn ngữ chính
Go
Star
111k
Fork
14.4k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
117

Mô tả

Bug Report

🔎 Search Terms

TS1005 allowJS

🕗 Version & Regression Information

3.3.3

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about allowJS and TS1005
  • I was unable to test this on prior versions because playground
⏯ Playground Link

https://www.typescriptlang.org/play?jsx=0&ts=3.3.3&filetype=js#code/C4JwrgpgPABA9AHQEZwHTAgZ2ACgER4CU8cMA8gNIBQokUiK6WuBxcpAYgIICSAMlSA

💻 Code

tsc --allowJs --checkJs test.js

true< /\b/.test("") // OK
true</\b/.test("") // FAIL

This is a small reproducing example.
The real-world code causing this issue is: https://unpkg.com/froala-editor@4.0.3/js/froala_editor.min.js

🙁 Actual behavior
:2:2 - error TS1005: ';' expected.
:2:7 - error TS1127: Invalid character.
:2:10 - error TS1109: Expression expected.
🙂 Expected behavior

Compiles successfully, because line 1 and line 2 are semantically equal in JS.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.