| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Iterate through the statements of the case-statements and don't warn
about a fall-through if the code path of the case-statements return or
break or throw before reaching the end of the case-block.
Amends 65804aaa928bbf6467e22da4bd35fcae1373af2d that introduced the
warning and only didn't check recursively for break, return or throw
statements inside of case blocks.
Pick-to: 6.10
Fixes: QTBUG-138532
Change-Id: I545898ebd52a4ec8f0ea58ca4ab5519e7137b6b0
Reviewed-by: Olivier De Cannière <[email protected]>
Reviewed-by: Lars Schmertmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems that our attached scopes have no base type: they don't inherit
the attached properties or methods because their baseTypeName is not
set.
Therefore, set their baseTypeName, and move the resolveTypes calls
inside of setScopeName() instead of potentially forgetting them after
enterEnvironment/RootScope() calls.
With the (resolved) base type, we know about inherited signals, like
in:
```
Keys.onPressed: { /*here is the "event" argument available*/ }
```
for example where we can insert the "event" JS identifier inside the
QQmlJSScope of the block of the signal handler, now that we now that
"Keys" has a "pressed"-method with one argument "event" on its base
type.
Add a test to make sure that the body of an attached signal handler
contains the JS identifier of the arguments of the attached signal to be
handled. This JS identifier is used later on in qmlls to provide
completions in the body of the attached signal handler.
Also fix LinterVisitor::leaveEnvironment() that starts complaining
about "Component" attached properties that have no child, now that
attached properties have base types.
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-137736
Change-Id: I8de0158ca9946d5e0e4f4f0a46614385f0edca69
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
| |
This mirrors the work on QQmlJSVisitor, and has the same reason: It
becomes possible to track which calls update an existing scopes, and
which calls create a new one.
Change-Id: I98f13f8ed2da436510d11c0e2203ea4b23cdf8ed
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
|
|
|
|
|
|
|
| |
A test was slightly adapted as a result.
Task-number: QTBUG-129307
Change-Id: I07ac61b183d9d7d237e9cf51ce3a0c6c280daa45
Reviewed-by: Sami Shalayel <[email protected]>
|
|
|
|
|
|
|
|
| |
Two other tests needed to be updated as a result.
Task-number: QTBUG-129307
Change-Id: I1470a5ae93cc20ef90ffd63471bd36408b61af57
Reviewed-by: Sami Shalayel <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Warn about ExpressionStatements that has no obvious effect in qmllint,
for example "x * 3;" is an expression statement that is either useless
or that potentially triggers user code with potential side-effects
during the custom coercion of "x". Warn that the expression statement
has no obvious effect.
Don't warn about expression statements inside of bindings: "y: x * 3" is
completely fine, for example.
Task-number: QTBUG-129307
Change-Id: I065ddce7394276296062545c1516ab9b4ad9f24d
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
| |
Task-number: QTBUG-129307
Change-Id: I95f633299ca94cb27c545a97a465bb5e24b5e3e8
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
| |
Fixes: QTBUG-119781
Task-number: QTBUG-119890
Change-Id: I392819ad0a47e0457c4b888894893ac37a77fa11
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-117300
Task-number: QTBUG-119890
Change-Id: If503b3dbfe9c8ad916afa3b570861f62c33e1fbd
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The warnings should be part of the linting visitor.
Introduce a new warning category for the exising warning about
duplicate enum entries.
Amends bbce9ea73fcb060916b75094f5a7fc64be5d7edd
This also (re)moves the test for warnings about enums in inline
components from qmltc. These warnings should be generated by qmllint.
Some files that had enum inside of inline components may no longer fail
to compile because of the warning. This is fine as the enum is not
accessible anyways.
Amends f368be4320306b637bdd5d7d8318cdb75406f2e4
Task-number: QTBUG-119890
Change-Id: I90f280e2e443504ab336b4c2ad85bf7e53e4544f
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-127325
Task-number: QTBUG-119890
Change-Id: I20b497da025dec8050ea94fc604db33a3ebdde77
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Implement the confusing pluses and minuses warnings. Those are triggered
for weird combinations of unary pluses and pre increments inside of
additions. (same for unary minuses and pre decrements).
Task-number: QTBUG-129307
Change-Id: I45c202efa58a588090d872f0bf8f43523c24a957
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Warn about usages of the void keyword. This warning is off by default,
mirroring the behavior of eslint.
Task-number: QTBUG-129307
Change-Id: Iba1cc09e028d5053ef1aa28f01f1694efa5c250f
Reviewed-by: Semih Yavuz <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Implement the WarnXConstructor and complain about a specific set of
constructors.
Task-number: QTBUG-129307
Change-Id: I27e0cfcb1f061bb2efff1721da4a2bbdb01fcf2f
Reviewed-by: Semih Yavuz <[email protected]>
|
|
|
|
|
|
|
|
| |
Warn when comma expressions are used outside of for-loops.
Task-number: QTBUG-129307
Change-Id: Ic86bf3af7f122f73b70e18c728c72f64c355f982
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Add a helper to retrieve the parent of the current node. It will be
needed in later commits to emit warnings.
Task-number: QTBUG-129307
Change-Id: Iaf6acd55db67e549ca8f34b5e20bf069d12349dd
Reviewed-by: Olivier De Cannière <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Move the stringliteral linting code into the new LinterImportVisitor
class.
Task-number: QTBUG-129307
Change-Id: I5f358f91c41e99383582be9fc1628814563848ed
Reviewed-by: Olivier De Cannière <[email protected]>
|
|
Add a visitor that creates warnings about qml and js code, to avoid
having all the warning-related but qqmljsscope-unrelated code in
qqmljsimportvisitor.
Task-number: QTBUG-129307
Change-Id: Icf56979d99855f11c5e72a0c9efbf9ecd629e42e
Reviewed-by: Olivier De Cannière <[email protected]>
|