Detect and fix direct imports of sap/m/URLHelper

Open
#1,138 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@flovogt is already working on this.

Since Sep 24, 2026.

Assessment

This issue has not been assessed yet.

Description

autofix detection

The UI5 linter should report an error when sap/m/URLHelper is imported directly as a module. URLHelper is not intended to be consumed via a standalone module import but must be accessed through sap/m/library.

Wrong usage

sap.ui.define([
  "sap/m/URLHelper"
], (URLHelper) => {
  "use strict";
  onInit() {
    URLHelper.redirect("https://www.openui5.org", true);
  }
});

Recommended usage

sap.ui.define([
  "sap/m/library"
], (mLibrary) => {
  "use strict";
  onInit() {
    mLibrary.URLHelper.redirect("https://www.openui5.org", true);
  }
});
Dominant language
TypeScript
Stars
82
Forks
14
Avg merge
10h 17m
Merged PRs (30d)
13

Getting set up

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.

More from UI5/linter

All issues in UI5/linter

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.