no-useless-escape is too aggressive
See original GitHub issueTell us about your environment
- ESLint Version: 3.10.2
- Node Version: 6.9.1
- npm Version: 3.10.8
What parser (default, Babel-ESLint, etc.) are you using? Default
Please show your full configuration: eslint-config-standard
6.2.1
Specifically:
{
"no-useless-escape": 2
}
What did you do? Please include the actual source code causing the issue.
/Expected property "1" of type \[Buffer\], got String "foobar"/
What did you expect to happen?
No error about a useless escape.
What actually happened? Please include the actual, raw output from ESLint.
Unnecessary escape character: \]. (no-useless-escape)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:10
- Comments:25 (21 by maintainers)
Top Results From Across the Web
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 >Disable Unnecessary escape character: \/ no-useless-escape
Your regex will work fine if you escape the regular metacharacters inside a character class, but doing so significantly reduces readability.
Read more >Improve Readability with ES6 Template Strings
This makes your string so much more readable, don't you think. If you use the eslint linter in your code, this is under...
Read more >The Case Against the Death Penalty - ACLU
Capital punishment has been a useless weapon in the so-called "war on drugs." The attempt to reduce murders in the drug trade by...
Read more >No Useless Mouth - eCommons@Cornell
Title: No useless mouth : waging war and fighting hunger ... have watched for escaped slaves so that they could capture them, black...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
@not-an-aardvark That solution (making the rule configurable to ignore particular useless escapes) would work for
standard
. Then we could configure it to ignore)
and]
.I still feel that this ought to be the default, because this looks incorrect and unbalanced:
But I’ll defer to you and the other contributors on this.
)
only needs to be escaped outside of character classes.