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.

\ character inside JSX text flags no-useless-escape

See original GitHub issue

This bug was confirmed by @kaicataldo in babel-eslint. https://github.com/babel/babel-eslint/issues/414 Tell us about your environment

  • ESLint Version: 3.6.0
  • Node Version: 6.5.0
  • npm Version: 3.10.3

What parser (default, Babel-ESLint, etc.) are you using? Babel

Please show your full configuration:

{
    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true
        }
    },
    "parser": "babel-eslint",
    "rules": {
      "no-useless-escape": ["error"]
    }
}

What did you do? Please include the actual source code causing the issue.

<div>Here it is: \ </div>

What did you expect to happen? No errors

What actually happened? Please include the actual, raw output from ESLint.

error Unnecessary escape character: \ no-useless-escape

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
nzakascommented, Nov 2, 2016

@ljharb thanks for explaining, I wasn’t aware of this.

@platinumazure JSX is a separate specification from React, so its behavior is well-defined. React applies semantics on top of JSX.

Just a reminder: please be sure to include relevant information (like that the slash isn’t an escape in JSX) in bug reports. Not everyone has such context in their brains. 😃

1reaction
kellyseldencommented, Nov 1, 2016

@platinumazure OK, thank you for the heads up. I will delete my comment to get rid of the noise.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React JSX error trying to use Less Than Symbol - Stack Overflow
am I getting an unexpected token error I guess because it thinks I am starting a new element rather than just wanting the...
Read more >
Rules - ESLint - Pluggable JavaScript Linter
Disallow characters which are made with multiple code points in character class syntax ... Enforce the use of variables within the scope they...
Read more >
4 Ways to Combine Strings in JavaScript | SamanthaMing.com
Escaping Characters in Strings. Escape Single Quotes or Apostrophes ('); Escape Double Quotes ("); Escape backtick (`). Which way to use?
Read more >
JSX In Depth - React
The first part of a JSX tag determines the type of the React element. Capitalized types indicate that the JSX tag is referring...
Read more >
Make line breaks work when you render text in a React or Vue ...
Sometimes you just want those pesky newline characters to actually work!. Tagged with react, vue, css, javascript.
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