Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114487

Absorb Qt Creator's QmlJS tool into standard QML tools

    XMLWordPrintable

Details

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtqmlteam Qt Qml Team User
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes