\ character inside JSX text flags no-useless-escape
See original GitHub issueThis 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:
- Created 7 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top 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 >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
@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. 😃
@platinumazure OK, thank you for the heads up. I will delete my comment to get rid of the noise.