Wrong no-useless-escape when escaping character after escaping "\"
See original GitHub issueTell us about your environment
Node version: v10.7.0 npm version: v6.8.0 Local ESLint version: v6.6.0 Global ESLint version: v6.6.0 (Currently used)
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
The problem exists with default settings.
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
The problem is when you try to escape a character after escaping a backslash.
const regEx = "[\\\/]"; //match backslash or forwardslash
Command used:
eslint
What did you expect to happen? No eslint error/warning.
What actually happened? Please include the actual, raw output from ESLint. no-useless-escape error/warning.
EDIT: Changed the example. Exclamation does not need an escape. But forwardslash does.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
https://xkcd.com/1638/
Hi @MarkusLund, thanks for the issue!
The example indeed looks like a useless escape: