question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support html-style comments

See original GitHub issue

TypeScript 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:open
  • Created 7 years ago
  • Reactions:8
  • Comments:16 (14 by maintainers)

github_iconTop GitHub Comments

14reactions
RyanCavanaughcommented, Aug 24, 2016

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.

4reactions
bterlsoncommented, Aug 24, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found