Skip to content

Commit

Permalink
fix: Fix testing leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
maxreichmann committed Feb 4, 2025
1 parent ef64f1c commit 658be06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/linter/binding/BindingLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ export default class BindingLinter {
}
} catch (err) {
const message = err instanceof Error ? err.message : String(err);
if (err instanceof Error) {
this.#context.addLintingMessage(this.#resourcePath, MESSAGE.PARSING_ERROR, {message}, position);
}
this.#context.addLintingMessage(this.#resourcePath, MESSAGE.PARSING_ERROR, {message}, position);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sap.ui.define(
// Although the formatter property does not look like a global notation,
// it should still be detected if it is a string:
const input2 = new Input({
value: "{ path: 'invoice>Status', formatter: formatter.statusText }"
value: "{ path: 'invoice>Status', formatter: 'formatter.statusText' }"
});
}
);
9 changes: 4 additions & 5 deletions test/lib/linter/rules/snapshots/NoGlobals.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Generated by [AVA](https://avajs.dev).
{
coverageInfo: [],
errorCount: 3,
fatalErrorCount: 1,
fatalErrorCount: 0,
filePath: 'FormatterGlobalBindingString.js',
messages: [
{
Expand All @@ -57,11 +57,10 @@ Generated by [AVA](https://avajs.dev).
},
{
column: 11,
fatal: true,
line: 15,
message: 'Expected \'a\' instead of \'o\'',
messageDetails: 'Check the source file for syntax errors',
ruleId: 'parsing-error',
message: 'Access of global variable \'formatter\' (formatter.statusText)',
messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)',
ruleId: 'no-globals',
severity: 2,
},
],
Expand Down
Binary file modified test/lib/linter/rules/snapshots/NoGlobals.ts.snap
Binary file not shown.

0 comments on commit 658be06

Please sign in to comment.