Skip to content

Commit

Permalink
fix: Rename var
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Mar 21, 2024
1 parent bf69572 commit 661a4bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/detectors/typeChecker/FileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ export default class FileLinter {
fnArgument: 0, // Lib.init() we're interested only in the first arg
});

let libVersion;
let nodeToHighlight;

if (fnArg === null) { // The method is init, but no argument has been found
libVersion = node;
nodeToHighlight = node;
} else if (fnArg) {
const apiKeyProp = (fnArg as ts.ObjectLiteralExpression)
.properties?.find((prop: ts.ObjectLiteralElementLike) => {
Expand All @@ -285,16 +285,16 @@ export default class FileLinter {
}) as ts.PropertyAssignment | undefined;

if (!apiKeyProp) { // no apiVersion key at all
libVersion = node;
nodeToHighlight = node;
} else if (ts.isLiteralExpression(apiKeyProp.initializer) && apiKeyProp.initializer.text !== "2") {
// Checks the value itself
libVersion = apiKeyProp;
nodeToHighlight = apiKeyProp;
}
}

if (libVersion) {
if (nodeToHighlight) {
this.#reporter.addMessage({
node: libVersion,
node: nodeToHighlight,
severity: LintMessageSeverity.Error,
ruleId: "ui5-linter-no-partially-deprecated-api",
message:
Expand Down

0 comments on commit 661a4bc

Please sign in to comment.