Skip to content

Commit 47e989b

Browse files
committed
frontend: fix linting
1 parent 3993db2 commit 47e989b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

frontend/.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@
4343
"no-else-return": "warn",
4444
"no-async-promise-executor": "off"
4545
},
46+
"overrides": [
47+
{
48+
"files": ["**/*.test.ts", "**/*.test.tsx", "src/__tests__/**"],
49+
"rules": {
50+
"@typescript-eslint/no-explicit-any": "off"
51+
}
52+
}
53+
],
4654
"ignorePatterns": [
4755
"dist/",
4856
"node_modules/",

frontend/src/__tests__/utils.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,18 @@ describe('utils', () => {
318318
it('handles logout message by setting LoggedOut state', () => {
319319
utils.loggedIn.value = utils.AppState.LoggedIn;
320320
const handler = (utils.bc as any).onmessage;
321-
handler && handler({ data: 'logout' });
321+
if (handler) {
322+
handler({ data: 'logout' });
323+
}
322324
expect(utils.loggedIn.value).toBe(utils.AppState.LoggedOut);
323325
});
324326

325327
it('triggers reload on login message', () => {
326328
const reloadSpy = vi.spyOn(window.location, 'reload').mockImplementation(() => { /* no-op */ });
327329
const handler = (utils.bc as any).onmessage;
328-
handler && handler({ data: 'login' });
330+
if (handler) {
331+
handler({ data: 'login' });
332+
}
329333
expect(reloadSpy).toHaveBeenCalled();
330334
});
331335

0 commit comments

Comments
 (0)