Closed matz3 closed 1 month ago
@matz3 created https://github.com/SAP/ui5-linter/compare/main...improve-import-declaration-deprecation-checks which is a PoC to tackle this. Lets discuss this in the team and discuss missing steps.
No exactly. It might contain details that are also relevant in here, but it tries to solve a different issue (which is not reported in this repo yet). That issue is: library
modules are not detected as deprecated when all their exports are deprecated (e.g. sap/ui/commons/library
) and I would rank it's priority a bit lower than this issue here about exported interfaces.
Expected Behavior
Declaring a dependency to a deprecated module (e.g. via sap.ui.define) should yield an error, even when no API of that module is being used.
Current Behavior
Declaring a dependency to a deprecated module which exports an interface (e.g. sap.ui.core.Configuration) does not yield an error.
I suspect that this is related to check for
symbol.valueDeclaration
and the different behavior for interfaces. ThevalueDeclaration
can beundefined
. This happens when there are no declarations associated with a symbol that could hold a value. If a symbol only represents an interface declaration,valueDeclaration
would beundefined
because an interface itself cannot hold a value. The code should probably check for all declarations of the symbol (symbol.getDeclarations()
).Steps to Reproduce the Issue
Run
ui5lint
for this code:Context
0.2.1
v20.11.1
10.2.4
macOS 14.4.1
Log Output / Stack Trace