Details
-
Suggestion
-
Resolution: Duplicate
-
P2: Important
-
None
Description
Qt Creator has a tool based on JSLint for static analysis of QML/JavaScript code: https://doc.qt.io/qtcreator/creator-checking-code-syntax.html#javascript-and-qml-error-codes
There is some overlap with the standard QML tools. For example:
- M300 "Unknown component" is already handled by qmllint (unresolved-type)
- M309 "Use spaces around binary operators" is already handled by qmlformat
However, there are some checks done by QmlJS that aren't currently done by the standard QML tools. For example:
- M400 "Duplicate import" (for keeping QML code clean)
- M126 "== and != perform type coercion, use === or !== to avoid it" (for avoiding common JS pitfalls)
Furthermore, there are some inconsistencies in how the checks are are configured for different tools (see QTBUG-112338 )
Suggestion
Go through every item listed at https://doc.qt.io/qtcreator/creator-checking-code-syntax.html#javascript-and-qml-error-codes and add any relevant ones to the standard QML tools. Once that's done and once QTBUG-102038 is complete, retire QmlJS.
Rationale
- We don't want to maintain multiple tools that do the same thing.
- We want the checks to keep up with the development of the QML language.
- We want the functionality to be accessible outside of Qt Creator too.
Attachments
Issue Links
- is required for
-
QTBUG-119890 qmllint warnings: reach feature parity with QtCreator
- Reported
-
QTBUG-119964 New QML LSP features (6.8)
- In Progress
- relates to
-
QTBUG-112338 Unify qmllint disable/enable comments with QML annotations and Qt Creator's @disable-check
- Reported
-
QTBUG-102038 qmlls is used in Qt Creator by default
- Withdrawn
-
QTCREATORBUG-17224 Integration of QML Lint in Qt Creator
- Closed
-
QDS-13302 Condition builder needs to support == equality as well as ===
- Reported