Disallow multiline strings
This rule is currently frozen and is not accepting feature requests.
It’s possible to create multiline strings in JavaScript by using a slash before a newline, such as:
const x = "Line 1 \
Line 2";
Some consider this to be a bad practice as it was an undocumented feature of JavaScript that was only formalized later.
This rule is aimed at preventing the use of multiline strings.
Examples of incorrect code for this rule:
/*eslint no-multi-str: "error"*/
const x = ;
Examples of correct code for this rule:
/*eslint no-multi-str: "error"*/
const x = "some very long text";
const y = "some very " +
"long text";
This rule has no options.
This rule was introduced in ESLint v0.0.9.
© OpenJS Foundation and other contributors
Licensed under the MIT License.
https://eslint.org/docs/latest/rules/no-multi-str