UI5 / UI5/linter

UI5 Linter does not detect deprecated API calls inside sap.ui.predefine

Open
#247 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

detection
Dominant language
TypeScript
Stars
79
Forks
13
Avg merge
19h 34m
Merged PRs (30d)
9

Description

Deprecated APIs inside sap.ui.predefine calls are not detected, I guess because sap.ui.predefine calls are not transpiled. Due to this, types inside the callback of sap.ui.predefine are not known to TypeScript.

Example:

sap.ui.predefine('mylib/library', ["sap/ui/core/Lib"], function(Library) {
	return Library.init({
		name: 'testlibs.scenario1.lib3',
		noLibraryCSS: true
	});
});

https://github.com/SAP/openui5/blob/7a9efdbc5ce7b03d48629a805078fc522e2b93fc/src/sap.ui.core/test/sap/ui/core/qunit/Lib.qunit.js#L82-L87
(apiVersion was missing, but this was not reported by the linter - In master, this has been fixed in the meantime)

Note: This issue is assumed to be specific to framework code only. sap.ui.predefine calls should not occur in application code.

Context

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sap.ui.predefine example in src/sap.ui.core/test/sap/ui/core/qunit/Lib.qunit.js, especially lines 82-87, and reproduce the missing apiVersion report with UI5 linter 0.2.2. Trace how sap.ui.predefine callbacks are handled by the linter; done when deprecated APIs and callback types are detected there, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.