no-useless-escape should ignore line breaks in strings
See original GitHub issueWhat version of ESLint are you using? 2.5.0
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Use this:
/*eslint no-useless-escape: 2 */
What did you do? Please include the actual source code causing the issue.
Create a multiline string separated by \
like this:
/* exported selectorCss */
function selectorCss() {
return '.someclass {\
color: #000000;\
opacity: 0.8;\
}';
}
What did you expect to happen? No errors or warnings
What actually happened? Please include the actual, raw output from ESLint.
5:9 error Unnecessary escape character: \
no-useless-escape
5:9 error Unnecessary escape character: \
no-useless-escape
5:9 error Unnecessary escape character: \
no-useless-escape
✖ 3 problems (3 errors, 0 warnings)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to not include line breaks when comparing two strings
i basically want to do a compare but dont include line breaks. So if line break is the only difference then consider them...
Read more >Handle line breaks (newlines) in Python - nkmk note
This article describes how to handle strings including line breaks (line feeds, new lines) in Python. Create a string containing line breaks.
Read more >How to remove line breaks from the string in PHP?
The line break can be removed from string by using str_replace() function. The str_replace() function is an inbuilt function in PHP which is ......
Read more >Remove line breaks or return codes from string
To remove line breaks from a string with StringDelete , you can simply do this: string = "I have imported string data, which...
Read more >Prevent line break in multi line text field - ServiceNow
We have an integration with DocuSign so when the user submits the form it got the error "String contains control character". When comparing...
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
I think having an
allowMultiline
orignoreMultiline
option would be good.I think we can move forward this.
I will work on this within a few days.