To write reusable QML code, I am looking for a (static code) checker that can detect unwanted dependencies in different qml files.
To give an example where B.qml depends on identifiers from A.qml:
A.qml
Item {
id: dependencyId
...
delegate: B {}
}
B.qml
Item {
id: delegateB
...
text: dependencyId.text
}
Since the B.qml text element is dependent on the identifier from A.qml, this code cannot be reused correctly.
Until the element identifier in A.qml changes, this code will be compiled / executed, and, therefore, the dependency will not be noticed. I tried QmlLint, but it gives no errors.
Can static code checks be installed for QML that can verify this?