JavaScript

JavaScript

Made by DeepSource

Avoid using multiline strings JS-C1000

Style
Minor
Autofix

It's possible to create multiline strings in JavaScript by using a slash before a newline. Some consider this to be a bad practice as it was an undocumented feature of JavaScript that was only formalized later. Consider using template strings or concatenating the strings instead.

Bad Practice

const x = "Line 1 \
         Line 2";

Recommended

const x = "Line 1\n" +
        "Line 2";

const x_ = `Line 1
Line 2`