.. _pyside6-qmllint:

pyside6-qmllint
===============

``pyside6-qmllint`` is a command line tool that wraps `qmllint`_. This tool
verifies the syntatic validity of QML files and warns about some QML
anti-patterns.

It is automatically run by the :ref:`pyside6-project` tool
when passing the ``qmllint`` argument instructing it to check
the QML source files.

Usage
-----

The tool should normally not be invoked manually since it requires
a number of import paths and additional type information
generated by :ref:`pyside6-qmltyperegistrar` to function.

For example, for a ``.qml`` file like:

.. code-block:: javascript

    import QtQuick
    import QtQuick.Controls

    Item {
        Text {
            id: name
            text: qsTr("Hello World")
        }
    }

when running:

.. code-block:: bash

    pyside6-qmllint Main.qml

it would warn about unused imports:

.. code-block::

    Info: Main.qml:2:1: Unused import [unused-imports]
    import QtQuick.Controls
    ^^^^^^

.. _`qmllint`: https://doc.qt.io/qt-6/qtquick-tool-qmllint.html
