diff --git a/src/detectors/typeChecker/FileLinter.ts b/src/detectors/typeChecker/FileLinter.ts index 51ff0071c..098f0db5d 100644 --- a/src/detectors/typeChecker/FileLinter.ts +++ b/src/detectors/typeChecker/FileLinter.ts @@ -208,6 +208,20 @@ export default class FileLinter { }); } + /** + * Gets arguments from a CallExpression. + * + * It could be the N-th argument from the call or it could + * find a named argument within argument's list. + * The callable function should have the following + * + * @param {ts.CallExpression} node + * @param {object} settings + * @param {string} settings.callExpressionName Method's name + * @param {string} settings.callExpressionPropName Object's instance name + * @param {string|number} settings.fnArgument The N-th argument or argument's name + * @returns + */ getFnArgument(node: ts.CallExpression, settings: { callExpressionName: string; callExpressionPropName: string; @@ -219,7 +233,7 @@ export default class FileLinter { !ts.isIdentifier(nodeExp.expression) || nodeExp?.expression?.text !== settings.callExpressionPropName) { // Didn't match Instance.call(), so we're not interested anymore of analyzing it. - return; + return "zzzz"; } let fnArgumentNode; diff --git a/test/fixtures/linter/projects/library.with.custom.paths/src/main/js/library.js b/test/fixtures/linter/projects/library.with.custom.paths/src/main/js/library.js index 5bc19ad9d..8beea433e 100644 --- a/test/fixtures/linter/projects/library.with.custom.paths/src/main/js/library.js +++ b/test/fixtures/linter/projects/library.with.custom.paths/src/main/js/library.js @@ -27,6 +27,11 @@ sap.ui.define([ apiVersion: 2 }); + // Should ignore + Library.anotherLibMethod({ + apiVersion: 23 + }) + // delegate further initialization of this library to the Core // Hint: sap.ui.getCore() must still be used to support preload with sync bootstrap!