SAP / ui5-linter

A static code analysis tool for UI5
Apache License 2.0
40 stars 0 forks source link

False positive: "Component Routing is not configured to load its targets asynchronously" in sap.fe application #184

Closed tobiasqueck closed 1 week ago

tobiasqueck commented 1 week ago

When running the linter in a newly generated Fiori elements application then an error is shown in the Component.js. The error indicates that the component needs to implement the interface sap.ui.core.IAsyncContentCreation, however, the interface is already implemented by the base class (sap/fe/core/AppComponent), therefore, it shouldn't be necessary.

Expected Behavior

No error in the Component.js

Current Behavior

6:16 **error** Component Routing is not configured to load its targets asynchronously.. Details: Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flag for "sap.ui5/routing/config" in the component manifest.

Steps to Reproduce the Issue

  1. Use the Fiori application generate and generate a LROP application for an OData v4 service
  2. Run npx --yes @ui5/linter@latest --details
  3. Check the console

Context

Log Output / Stack Trace

{...}
tobiasqueck commented 1 week ago

@nlunets @petermuessig here is the continuation of our internal discussion.

tobiasqueck commented 1 week ago

@RandomByte could you please let me know which version of the linter contains the fix so that I can retest. I'd also appreciate if you could keep the issue open until the fix is verified.

RandomByte commented 1 week ago

Sorry, the issue got closed automatically with the merge of the PR. No release has been created yet

RandomByte commented 1 week ago

The proposed fix is released with v0.2.6

tobiasqueck commented 1 week ago

Perfect, I can confirm that it works as expected

~/tmp/project2 (main)> npx --yes @ui5/linter@0.2.5 --details
UI5 linter report:

~/tmp/project2/webapp/Component.js
  6:16 error Component Routing is not configured to load its targets asynchronously.. Details: Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flag for "sap.ui5/routing/config" in the component manifest.

1 problems (1 errors, 0 warnings)
~/tmp/project2 (main)> npx --yes @ui5/linter@0.2.6 --details 
UI5 linter report:

0 problems (0 errors, 0 warnings)
RandomByte commented 1 week ago

Thanks for reporting and confirming the fix!