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.

Failing cases in JSX mode

See original GitHub issue

Following up on: https://github.com/codemirror/CodeMirror/pull/3742

Three from the jsx/index.html page:

  1. Boolean attributes are not recognized properly (note the red self-closing />) screen shot 2015-12-29 at 9 41 02 am
  2. Block comments styled incorrectly (should be the brown comment color)
  3. Line comments are not recognized properly (note the red self-closing />) screen shot 2015-12-29 at 9 41 30 am

Two other things I’ve found:

4 . Elements should be allowed as attributes screen shot 2015-12-29 at 9 42 54 am

5 . Indentation in JS expressions should be relative to the indentation level of JSX elements. I believe currently they get indented to prior JS indentation level. (this issue is highest priority, if I had to choose)

Current behavior gif here: js-expression-indentation

Correct position here: screen shot 2015-12-29 at 10 05 11 am

Another example of current behavior (not followed by } char): js-indentation-2

Correct position here: screen shot 2015-12-29 at 10 08 29 am

@parisk @petetnt

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:21 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
julienwcommented, Dec 13, 2017

I don’t really understand why, if there’s already all this. I’m not saying the code should be physically copied, but enabling the Javascript syntax should IMO also enable JSX… especially if TypeScript and others are also already enabled.

0reactions
adrianheinecommented, Dec 15, 2017

If you select JavaScript mode, you get JavaScript, not TypeScript or JSX. These are different languages, they just happen to share a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React automatic JSX fails with custom mode and externally set ...
The JSX transform doesn't seem to pick up NODE_ENV in this case, leading to importing JSX factory from jsx-dev-runtime , which is not ......
Read more >
Error Boundaries - React
A class component becomes an error boundary if it defines either (or both) of the lifecycle methods static getDerivedStateFromError() or componentDidCatch() .
Read more >
Setup - Testing Library
In these docs we'll demonstrate configuring Jest, but you should be able to do similar things with any testing framework (React Testing Library ......
Read more >
How To Test Your React Apps With The React Testing Library
Both test cases are failing. Now let's add the component implementation to make them pass. Open src/TodoItem.js and update the code to the ......
Read more >
How to Test React Components: the Complete Guide
The tests will pass if your hypothesis is correct and fail if it is wrong. Unlike your react components, your tests are not...
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