Support html-style comments
See original GitHub issueTypeScript Version: 1.8.0
Code
<!-- console.log(1) -->
Expected behavior: The ECMAScript spec defines HTML-style comments that are allowed in scripts, so the above script is syntactically valid. This syntax is allowed in browsers and Node.
Actual behavior: Syntax error.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:16 (14 by maintainers)
Top Results From Across the Web
Comments - CSS: Cascading Style Sheets - MDN Web Docs
The /* */ comment syntax is used for both single and multiline comments. There is no other way to specify comments in external...
Read more >CSS Comments - W3Schools
CSS Comments. Comments are used to explain the code, and may help when you edit the source code at a later date. Comments...
Read more >The HTML Comment Tag: Here's How To Use It In Your Code »
This element is used to add a comment to an HTML document. An HTML comment begins with <!–– and the comment closes with...
Read more >HTML Comments: How to Use Them - HubSpot Blog
Adding comments in HTML can help you write and organize the backend of your webpage. They're so useful that it's considered a best...
Read more >HTML Comments - Free, Online Tutorial | W3Docs
The HTML comments are used to indicate sections of a document or insert notes explaining the code. They help understand the code and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is blocking me from adopting TypeScript
Edit: @yortus had a good idea about downleveling. I think this should be the default, with a
--noEmit<!---->Comments
flag for those who want to retain lame-style (//
,/*
) comments.Also worth noting that there is some disagreement within TC39 about whether Annex B is really optional in any sense. For example, why wouldn’t Node want to run code designed to run in web browsers? An argument can be made it’s just a way for the committee to feel good about putting bad but necessary features in a different place. And in practice, Annex B seems to be implemented everywhere.