Skip to content

UI5 Linter does not know / accept sap.ui.predefine or sap.ui.require.preload in bundles #248

@flovogt

Description

@flovogt

In a bundle file (no matter whether it's a Component-preload.js or a library-preload.js file) calls to the bundle-only APIs sap.ui.predefine or sap.ui.require.preload are reported as use of a disallowed global.

Example: https://github.com/SAP/openui5/blob/master/src/sap.ui.core/test/sap/ui/core/qunit/testdata/libraries/scenario1/lib1/library-preload.js#L2

While this might be limited to framework code, it might be fixable in a robust way. UI5 tooling adds comments to bundles that would allow to identify them

//@ui5-bundle sap/f/library-preload.js
/*!
 * OpenUI5
 * (c) Copyright 2009-2024 SAP SE ...

@codeworrior added those comments to the manually created preloads in sap.ui.core, just in case we want to use them as markers.

As the two APIs in question are not documented as public APIs (only restricted, AFAIK), they either might have to be added to the overlay or have to be listed in the linter's source (similar to the other allowed globals).

Note: This issue is assumed to be specific to framework code only. It's not likely that application code or reuse libs create (non-empty) bundles as part of the sources.

Context

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    detectionAn issue related to detection capabilities

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions