no-useless-escape false positives on JSX strings
See original GitHub issueThis is a JSX issue, but since it’s in eslint/no-useless-escape
I thought it would be appropriate to file here.
What version of ESLint are you using? 2.8.0
What parser (default, Babel-ESLint, etc.) are you using? Babel-ESLint
Please show your full configuration: It’s super long but these should be enough,
module.exports = {
// base off Airbnb Javascript Style Guide
// https://github.com/airbnb/javascript
'extends': [
'eslint-config-airbnb',
],
'parser': 'babel-eslint',
}
What did you do? Please include the actual source code causing the issue.
<input
autoComplete="cc-cvc cc-csc"
maxLength="4"
pattern="[\d]{3,4}"
placeholder="CVC"
/>
What did you expect to happen?
The pattern "[\d]{3,4}"
would not be flagged as the backslash is not an escape character in this context. (It’s a literal backslash, like in HTML.)
What actually happened? Please include the actual, raw output from ESLint.
135:21 error Unnecessary escape character: \d no-useless-escape
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
eslint: false positive no-useless-escape : r/reactjs - Reddit
But eslint saying that I do not need backslash, but without backslash it will be not "non-space" but S. React version is 16.12.0....
Read more >type="number" react typescript false positive in onChange?
I got error in line 24. Argument of type 'string' is not assignable to parameter of type ' ...
Read more >no-useless-escape - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >The Better Way to Type React Components | by Mikael Brevik
Using props directly on parameters allow you to more correctly type components and avoid false positives while also being more flexible.
Read more >Cross-site Scripting in React Web Applications - Invicti
React is a popular JavaScript framework for building user interfaces. ... Let's take a look at the User-Agent string the Chrome browser uses ......
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
Ah well, worth a shot. Thanks for trying those out. I’ll dig in further when I get home. On Apr 18, 2016 4:44 PM, “Turadg Aleahmad” notifications@github.com wrote:
I saw the spec: https://facebook.github.io/jsx/ JSXText seems to not have any escape sequence.
And I confirmed this with espree, too. I will fix this.