noMultiStr
Это содержимое пока не доступно на вашем языке.
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noMultiStr - This rule doesn’t have a fix.
- The default severity of this rule is error.
- Sources:
- Same as
no-multi-str
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noMultiStr": "error" } } }}Description
Section titled “Description”Disallow creating multiline strings by escaping newlines.
Escaping newlines to create multiline strings is discouraged because it can lead to subtle errors caused by unexpected whitespace after the backslash.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”const foo = "Line 1\n\Line 2";code-block.js:2:5 lint/nursery/noMultiStr ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Escaping newlines to create multiline strings is disallowed.
1 │ const foo =
> 2 │ “Line 1\n\
│ ^^^^^^^^^^
> 3 │ Line 2”;
│ ^^^^^^^
4 │
const foo = "Line 1\nLine 2";const bar = `Line 1Line 2`;Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.