microsoft / microsoft/TypeScript
JS files should parse as JS, not as JSX
Open
@sandersn is already working on this.
Since Jul 26, 2021.
Awaiting More Feedback
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
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
💻 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.