Skip to content

Commit

Permalink
fix: Add docs and enhance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Mar 18, 2024
1 parent 7f41fba commit a3affb6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/detectors/typeChecker/FileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down

0 comments on commit a3affb6

Please sign in to comment.