question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no-useless-escape should ignore line breaks in strings

See original GitHub issue

What 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:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
BYKcommented, Mar 26, 2016

I think having an allowMultiline or ignoreMultiline option would be good.

0reactions
mysticateacommented, Mar 29, 2016

I think we can move forward this.

  • This was intended, but we can change the behavior to allowing multiline strings as no-multi-str is covering this. I think this is not a breaking change since this is easing.

I will work on this within a few days.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found