Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing detection of dependency to deprecated modules that export an interface #86

Open
matz3 opened this issue Apr 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@matz3
Copy link
Member

matz3 commented Apr 18, 2024

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.
The valueDeclaration can be undefined. 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 be undefined 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:

sap.ui.define(["sap/ui/core/Configuration"]);

Context

  • UI5 linter package and version: 0.2.1
  • Node.js Version: v20.11.1
  • npm Version: 10.2.4
  • OS/Platform: macOS 14.4.1

Log Output / Stack Trace

UI5 linter report:

0 problems (0 errors, 0 warnings)
@matz3 matz3 added the bug Something isn't working label Apr 18, 2024
@matz3 matz3 mentioned this issue Apr 23, 2024
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant