- Qt 6.11
- Qt Qml
- Qt Qml Tooling
- qmllint
- QML Lint Warning and Errors
- Multiline strings
- Qt 6.11.1 Reference Documentation

Missing type ◦ Non-list property

# Multiline strings

This warning category is spelled `[multiline-strings]` by qmllint.

## String contains unescaped line terminator, which is deprecated

### What happened?

A string spans over multiple lines.

### Why is this bad?

Strings spanning multiple lines are a non-standard extension of ECMAScript and deprecated in QML. Use template literals instead.

### Example

     import QtQuick

     Item {
         property string multiLine: "first
     second
     third"

         property string multiLine2: 'first
     second
     third'
     }

To fix this warning, use template literals or, alternatively, replace the newlines with '\n':

     import QtQuick

     Item {
         property string multiLine: `first
     second
     third`
         property string multiLine2: `first
     second
     third`

         property string alternative: "first\nsecond\nthird"
         property string alternative2: "first\n" +
     "second\n" +
     "third"
     }

Missing type ◦ Non-list property