Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
6.5.2
-
None
Description
QML Coding Convention says:
"If the code is longer than one line and hence within a block, we use semicolons to indicate the end of each statement"
https://doc.qt.io/qt-6/qml-codingconventions.html#javascript-code
This implies that a single line of JavaScript doesn't require a semicolon.
Now, if I qmlformat this:
Window { id: myWindow width: 640 height: 480 visible: true property bool connected: false Label { text: { myWindow.connected ? qsTr("Connected") : qsTr("Disconnected") } } }
There is a semicolon added:
text: { myWindow.connected ? qsTr("Connected") : qsTr("Disconnected"); }
Attachments
Issue Links
- is covered by
-
QTBUG-107152 qmlformat: Allow customizing semicolon rules
-
- Open
-