Skip to content

Commit

Permalink
refactor: Ignore cases with non-string literal elements
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Jul 16, 2024
1 parent 47c98bc commit 35b4f1c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/linter/ui5Types/SourceFileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,14 @@ export default class SourceFileLinter {
}

dependenciesNode.initializer.elements.forEach((dependency) => {
let curLibName = "";
if (ts.isStringLiteral(dependency)) {
curLibName = dependency.text;
if (!ts.isStringLiteral(dependency)) {
// We won't be interested if the elements of the Array are not of type
// StringLiteral, so we ignore such cases here (if such at all).
return;
}

const curLibName = dependency.text;

if (deprecatedLibraries.includes(curLibName)) {
this.#reporter.addMessage({
ruleId: RULES["ui5-linter-no-deprecated-api"],
Expand Down

0 comments on commit 35b4f1c

Please sign in to comment.