]> git.proxmox.com Git - pve-eslint.git/blame - eslint/docs/rules/no-multi-str.md
bump version to 8.4.0-3
[pve-eslint.git] / eslint / docs / rules / no-multi-str.md
CommitLineData
eb39fafa
DC
1# Disallow Multiline Strings (no-multi-str)
2
3It's possible to create multiline strings in JavaScript by using a slash before a newline, such as:
4
5```js
6var x = "Line 1 \
7 Line 2";
8```
9
10Some consider this to be a bad practice as it was an undocumented feature of JavaScript that was only formalized later.
11
12## Rule Details
13
14This rule is aimed at preventing the use of multiline strings.
15
16Examples of **incorrect** code for this rule:
17
18```js
19/*eslint no-multi-str: "error"*/
456be15e
TL
20
21var x = "some very \
22long text";
eb39fafa
DC
23```
24
25Examples of **correct** code for this rule:
26
27```js
28/*eslint no-multi-str: "error"*/
29
456be15e
TL
30var x = "some very long text";
31
32var x = "some very " +
33 "long text";
eb39fafa 34```