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.

<!-- style comments not recognized when parsing JSX

See original GitHub issue

Evidently <!-- ... single-line comments are valid in JavaScript. eslint doesn’t seem to recognize this.

Source: https://twitter.com/bterlson/status/768211703314067457 and http://www.ecma-international.org/ecma-262/7.0/index.html#prod-annexB-SingleLineHTMLOpenComment

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mysticateacommented, Aug 28, 2016
1reaction
mysticateacommented, Aug 28, 2016

I got a fact that HTML comments trigger a syntax error if it’s using JSX option. I reopen this issue.

$ echo "<!--" | eslint --stdin --no-eslintrc

no errors

$ echo "<!--" | eslint --stdin --no-eslintrc --parser-options "ecmaFeatures:{jsx:true}"

<text>
  1:2  error  Parsing error: Unexpected token !

✖ 1 problem (1 error, 0 warnings)
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use comments in React - Stack Overflow
Within React(JSX), you can use {/* comment here */} , however for javascript // comment here works. So, the answer depends on where...
Read more >
How to comment in React JSX - Wes Bos
Regular JavaScript comments in JSX get parsed as Text and show up in your app. Comments in JSX are weird and when searching...
Read more >
React Native Comments - 2 Ways to Add Comments in JSX
Adding a comment in React Native code is not difficult but it's weird. ... Regular JavaScript comments in JSX get parsed as Text....
Read more >
babel/parser
The Babel parser (previously Babylon) is a JavaScript parser used in Babel. ... When this option is set to false , comments are...
Read more >
Documentation - JSX - TypeScript
createElement , does not need to go through a JSX transformation before use, ... and is identical in behavior to the angle-bracket type...
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