pve-eslint/eslint/docs/rules/no-multi-str.md
Thomas Lamprecht 456be15ea9 import eslint 7.18.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 16:04:55 +01:00

35 lines
685 B
Markdown

# Disallow Multiline Strings (no-multi-str)
It's possible to create multiline strings in JavaScript by using a slash before a newline, such as:
```js
var 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.
## Rule Details
This rule is aimed at preventing the use of multiline strings.
Examples of **incorrect** code for this rule:
```js
/*eslint no-multi-str: "error"*/
var x = "some very \
long text";
```
Examples of **correct** code for this rule:
```js
/*eslint no-multi-str: "error"*/
var x = "some very long text";
var x = "some very " +
"long text";
```