Skip to content

Commit d8f7c56

Browse files
committed
Lint updates and change useScripts to an arrow function
1 parent f6d6d99 commit d8f7c56

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/ui/hooks/useScripts.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ describe("useScripts", () => {
103103
});
104104

105105
it("should handle undefined scripts prop", () => {
106+
// @ts-expect-error Testing undefined input
107+
// eslint-disable-next-line
106108
renderHook(() => useScripts(undefined, mockWidgetId, mockCallback));
107109

108110
expect(useSubscription).toHaveBeenCalledWith(mockWidgetId, [], []);

src/ui/hooks/useScripts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import {
1313
} from "../widgets/EmbeddedDisplay/scripts/scriptExecutor";
1414
import { Script } from "../../types/props";
1515

16-
export function useScripts(
16+
export const useScripts = (
1717
scriptsProp: Script[],
1818
widgetId: string,
1919
callback: (scriptResponse: ScriptResponse) => void
20-
) {
20+
) => {
2121
const scripts = scriptsProp ?? [];
2222
const allPvs: string[] = [];
2323
const allTypes: SubscriptionType[] = [];
@@ -70,4 +70,4 @@ export function useScripts(
7070
log.warn(reason);
7171
});
7272
}
73-
}
73+
};

0 commit comments

Comments
 (0)