SAP / ui5-linter

A static code analysis tool for UI5
Apache License 2.0
47 stars 4 forks source link

False positives when linting HTML with multiple bootstrap candidates (v1.0.0) #335

Closed codeworrior closed 3 days ago

codeworrior commented 3 days ago

Expected Behavior

When I lint an HTML page with a UI5 2.0-compliant bootstrap, I don't get findings from the UI5 linter.

Current Behavior

When I lint for example sap.ui.core, I get two errors in this unit test page, for the two script tags for ui5loader and ui5loader-autoconfig. But the runtime only takes the script with id="sap-ui-bootstrap" into account and ignores the others (wrt. configuration).

Shouldn't the linter first determine which script tag will be evaluated by the runtime and only check that one?

Steps to Reproduce the Issue

Just lint sap.ui.core (master or main).

Context

Log Output / Stack Trace

(The following lines are not directly from the log, but from a report based on the JSON output)

37:3: Missing bootstrap parameter 'data-sap-ui-async'
38:3: Missing bootstrap parameter 'data-sap-ui-async'
RandomByte commented 3 days ago

We decided to always analyze both script tags, expecting that this wouldn't be used (correctly) in the wild anyways. I guess we were wrong. Shouldn't be a problem fixing it 👍

codeworrior commented 3 days ago

Cool, thank you!