aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljslogger.cpp
diff options
context:
space:
mode:
authorOlivier De Cannière <[email protected]>2025-05-28 15:00:38 +0200
committerOlivier De Cannière <[email protected]>2025-05-30 22:25:39 +0200
commit2e00bc40cce9286dcb1ef9ff88845778c316592c (patch)
tree3806195ff655f2c41443748d4da8229d8c3b3ef6 /src/qmlcompiler/qqmljslogger.cpp
parentafc5a1c6f49e33cee07d098728e3c0702e95d168 (diff)
qmllint: Warn about unintentional empty blocksHEADdev
If a property binding is a js block without any statements, it could mean that the user intended to create an object literal instead of an empty block that returns undefined. Task-number: QTBUG-129307 Change-Id: If242ddac140cce6479062194b785096ba1f6c0a6 Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/qmlcompiler/qqmljslogger.cpp')
-rw-r--r--src/qmlcompiler/qqmljslogger.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljslogger.cpp b/src/qmlcompiler/qqmljslogger.cpp
index d3cf05fb1d..40bdd9c48d 100644
--- a/src/qmlcompiler/qqmljslogger.cpp
+++ b/src/qmlcompiler/qqmljslogger.cpp
@@ -131,6 +131,8 @@ using namespace Qt::StringLiterals;
false, false) \
X(qmlUncreatableType, "uncreatable-type", "UncreatableType", \
"Warn if uncreatable types are created", QtWarningMsg, false, false) \
+ X(qmlUnintentionalEmptyBlock, "unintentional-empty-block", "UnintentionalEmptyBlock", \
+ "Warn about bindings that contain only an empty block", QtWarningMsg, false, false) \
X(qmlUnqualified, "unqualified", "UnqualifiedAccess", \
"Warn about unqualified identifiers and how to fix them", QtWarningMsg, false, false) \
X(qmlUnreachableCode, "unreachable-code", "UnreachableCode", "Warn about unreachable code.", \