SAP / ui5-linter

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

Unexpected or inconsistent reports of globals #305

Closed codeworrior closed 2 weeks ago

codeworrior commented 2 weeks ago

Expected Behavior

When a global symbol is used in code, either each usage should be reported, or none. Global APIs that are part of the platform (ES2023, browser) should never be reported. Also, non-UI5 globals, whose usage is legitimated via ESLint config maybe should not be reported (to be discussed).

Current Behavior

When linting the OpenUI5 sources, platform globals are reported unexpectedly:

In OpenUI5's own test code, QUnit is most of the time used as a global (which is accepted in UI5 code). But those usages are sometimes reported (seems, only when QUnit is accessed via indexed member access QUnit[...something]):

All other usages are not reported. Either those few usages should also not be reported (e.g. when an eslint comment /* global QUnit */ or ESLint config exists) or all usages should be reported consistently (not preferred).

Steps to Reproduce the Issue

  1. Lint sap.ui.core from OpenUI5 or, if you have access to internal builds, look at the nightly UI5 2.0 transformation build and check the linting result file ui5lint-openui5-_openui5_sap.ui.core.json.

Context

Log Output / Stack Trace

See findings above.