ui5-migration icon indicating copy to clipboard operation
ui5-migration copied to clipboard

'migrate' command adds duplicate parameters to sap.ui.define call

Open codeworrior opened this issue 5 years ago • 0 comments

While working on https://github.com/SAP/openui5/commit/c782ce9be8cbd71201e19ba3cb4c0e81e439b71f , I encountered the following issue with the ui5-migration tooling:

In sap.m.Page, the tooling added a dependency to jQuery and to a jQuery UI plugin and gave both a local parameter name of jQuery. This resulted in an eslint error

Strict mode function may not have duplicate parameter names

Resulting code after migration

sap.ui.define([
    ...
    "./PageRenderer",
    "sap/ui/thirdparty/jquery",
    "sap/ui/thirdparty/jqueryui/jquery-ui-position"
],
function(
	...
	PageRenderer,
	jQuery,
	jQuery
) {
		"use strict";

To reproduce, you can execute the following commands

cd openui5
git checkout 6555a38
ui5-migration migrate src/sap.m/src/sap/m/Page.js
eslint -q src/sap.m/src/sap/m/Page.js

codeworrior avatar Jul 15 '19 22:07 codeworrior