Escape characters are handled incorrectly in inline config comments
See original GitHub issueTell us about your environment
- ESLint Version: v4.7.2
- Node Version: v8.5.0
- npm Version: Yarn v1.0.2
What parser (default, Babel-ESLint, etc.) are you using? Default
Please show your full configuration:
Configuration
rules:
id-match: [2, "^(([^$\\W]|\\$[a-f\\d]{2})+|[$_]\\w*|[^\\W\\d]\\w*|[A-Z]([A-Z_]*[A-Z])?)$", {
properties: true
}]
What did you do? Please include the actual source code causing the issue.
/* eslint id-match: [2, "^(([^$\\W]|\\$[a-f\\d]{2})+|[$_]\\w*|[^\\W\\d]\\w*|[A-Z]([A-Z_]*[A-Z])?)$", {properties: true}] */
function is$2dvoid(value) {
return value == null
}
What did you expect to happen? It to pass (as it does without the comment)
What actually happened? Please include the actual, raw output from ESLint.
/path/to/file.js
3:10 error Identifier 'is$2dvoid' does not match the pattern '^(([^$\\W]|\\$[a-f\\d]{2})+|[$_]\\w*|[^\\W\\d]\\w*|[A-Z]([A-Z_]*[A-Z])?)$' id-match
✖ 1 problem (1 error, 0 warnings)
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (13 by maintainers)
Top Results From Across the Web
How do I escape characters in C# comments? - Stack Overflow
If you need to escape characters in XML comments, you need to use the character entities, so < would need to be escaped...
Read more >Azure Data Factory (ADF) Escape Character Issue When ...
It seems this is an issue with ADF and whenever an escape character exists in data that is at the end of a...
Read more >Escaping characters in Java - CodeGym
Hi! In previous lessons, we've already gotten acquainted with text strings, which are represented by the String class in Java.
Read more >What characters do I need to escape when using sed in a sh ...
4 Answers 4 · Write the regex between single quotes. · Use '\'' to end up with a single quote in the regex....
Read more >linux - bash: how to pass command line arguments containing ...
Use single quotes. Single quotes ensure that none of the characters are interpreted. $ printf % ...
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 Free
Top 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
The levn project has just issued version 0.4.1 which allows quoted string literals to use the same escaping rules as JavaScript itself, so upgrading to latest levn may resolve this issue.
How do we want to proceed with this? It unfortunately doesn’t look like there has been any movement on the
levn
issue. It seems like moving away fromlevn
might be the prudent thing to do.