diff --git a/packages/business-features/keyboard-shortcuts/src/invoke-shortcut.injectable.ts b/packages/business-features/keyboard-shortcuts/src/invoke-shortcut.injectable.ts index 5b0c324203..ecab52138b 100644 --- a/packages/business-features/keyboard-shortcuts/src/invoke-shortcut.injectable.ts +++ b/packages/business-features/keyboard-shortcuts/src/invoke-shortcut.injectable.ts @@ -1,11 +1,7 @@ import { pipeline } from "@ogre-tools/fp"; import { filter, isString } from "lodash/fp"; import { getInjectable } from "@ogre-tools/injectable"; -import { - Binding, - KeyboardShortcut, - keyboardShortcutInjectionToken, -} from "./keyboard-shortcut-injection-token"; +import { Binding, KeyboardShortcut, keyboardShortcutInjectionToken } from "./keyboard-shortcut-injection-token"; import platformInjectable from "./platform.injectable"; export type InvokeShortcut = (event: KeyboardEvent) => void; @@ -46,29 +42,26 @@ const toBindingWithDefaults = (binding: Binding) => ...binding, }; -const toShortcutsWithMatchingBinding = - (event: KeyboardEvent, platform: string) => (shortcut: KeyboardShortcut) => { - const binding = toBindingWithDefaults(shortcut.binding); +const toShortcutsWithMatchingBinding = (event: KeyboardEvent, platform: string) => (shortcut: KeyboardShortcut) => { + const binding = toBindingWithDefaults(shortcut.binding); - const shiftModifierMatches = binding.shift === event.shiftKey; - const altModifierMatches = binding.altOrOption === event.altKey; + const shiftModifierMatches = binding.shift === event.shiftKey; + const altModifierMatches = binding.altOrOption === event.altKey; - const isMac = platform === "darwin"; + const isMac = platform === "darwin"; - const ctrlModifierMatches = - binding.ctrl === event.ctrlKey || (!isMac && binding.ctrlOrCommand === event.ctrlKey); + const ctrlModifierMatches = binding.ctrl === event.ctrlKey || (!isMac && binding.ctrlOrCommand === event.ctrlKey); - const metaModifierMatches = - binding.meta === event.metaKey || (isMac && binding.ctrlOrCommand === event.metaKey); + const metaModifierMatches = binding.meta === event.metaKey || (isMac && binding.ctrlOrCommand === event.metaKey); - return ( - event.code === binding.code && - shiftModifierMatches && - ctrlModifierMatches && - altModifierMatches && - metaModifierMatches - ); - }; + return ( + event.code === binding.code && + shiftModifierMatches && + ctrlModifierMatches && + altModifierMatches && + metaModifierMatches + ); +}; const invokeShortcutInjectable = getInjectable({ id: "invoke-shortcut", diff --git a/packages/business-features/keyboard-shortcuts/src/keyboard-shortcut-listener.tsx b/packages/business-features/keyboard-shortcuts/src/keyboard-shortcut-listener.tsx index 5f2479d059..5dad663129 100644 --- a/packages/business-features/keyboard-shortcuts/src/keyboard-shortcut-listener.tsx +++ b/packages/business-features/keyboard-shortcuts/src/keyboard-shortcut-listener.tsx @@ -26,10 +26,7 @@ const NonInjectedKeyboardShortcutListener = ({ return <>{children}; }; -export const KeyboardShortcutListener = withInjectables< - Dependencies, - KeyboardShortcutListenerProps ->( +export const KeyboardShortcutListener = withInjectables( NonInjectedKeyboardShortcutListener, { diff --git a/packages/business-features/keyboard-shortcuts/src/keyboard-shortcuts.test.tsx b/packages/business-features/keyboard-shortcuts/src/keyboard-shortcuts.test.tsx index d2bbfb85a4..3631a4fa98 100644 --- a/packages/business-features/keyboard-shortcuts/src/keyboard-shortcuts.test.tsx +++ b/packages/business-features/keyboard-shortcuts/src/keyboard-shortcuts.test.tsx @@ -175,8 +175,7 @@ describe("keyboard-shortcuts", () => { shouldCallCallback: true, }, { - scenario: - "given shortcut with shift modifier, when shortcut is pressed, calls the callback", + scenario: "given shortcut with shift modifier, when shortcut is pressed, calls the callback", binding: { shift: true, code: "F1" }, keyboard: "{Shift>}[F1]", diff --git a/packages/technical-features/messaging/computed-channel/index.ts b/packages/technical-features/messaging/computed-channel/index.ts index dd72ecf71b..ba98df8cca 100644 --- a/packages/technical-features/messaging/computed-channel/index.ts +++ b/packages/technical-features/messaging/computed-channel/index.ts @@ -3,7 +3,4 @@ export { computedChannelObserverInjectionToken, } from "./src/computed-channel/computed-channel.injectable"; -export type { - ChannelObserver, - ComputedChannelFactory, -} from "./src/computed-channel/computed-channel.injectable"; +export type { ChannelObserver, ComputedChannelFactory } from "./src/computed-channel/computed-channel.injectable"; diff --git a/packages/technical-features/messaging/computed-channel/src/computed-channel/computed-channel.injectable.ts b/packages/technical-features/messaging/computed-channel/src/computed-channel/computed-channel.injectable.ts index b652a0c795..99d5d18fec 100644 --- a/packages/technical-features/messaging/computed-channel/src/computed-channel/computed-channel.injectable.ts +++ b/packages/technical-features/messaging/computed-channel/src/computed-channel/computed-channel.injectable.ts @@ -1,23 +1,13 @@ import { getInjectable, getInjectionToken } from "@ogre-tools/injectable"; -import { - computed, - IComputedValue, - observable, - onBecomeObserved, - onBecomeUnobserved, - runInAction, -} from "mobx"; +import { computed, IComputedValue, observable, onBecomeObserved, onBecomeUnobserved, runInAction } from "mobx"; import type { MessageChannel } from "@k8slens/messaging"; import { getMessageChannelListenerInjectable } from "@k8slens/messaging"; import { sendMessageToChannelInjectionToken } from "@k8slens/messaging"; import { computedChannelAdministrationChannel } from "./computed-channel-administration-channel.injectable"; -export type ComputedChannelFactory = ( - channel: MessageChannel, - pendingValue: T, -) => IComputedValue; +export type ComputedChannelFactory = (channel: MessageChannel, pendingValue: T) => IComputedValue; export const computedChannelInjectionToken = getInjectionToken({ id: "computed-channel-injection-token", diff --git a/packages/technical-features/react-application/src/react-application/react-application.tsx b/packages/technical-features/react-application/src/react-application/react-application.tsx index 933d0ad389..982a49a3c1 100644 --- a/packages/technical-features/react-application/src/react-application/react-application.tsx +++ b/packages/technical-features/react-application/src/react-application/react-application.tsx @@ -27,9 +27,7 @@ const render = (components: ReactApplicationHigherOrderComponent[]) => { export const ReactApplication = observer(({ di }: ReactApplicationProps) => { const computedInjectMany = di.inject(computedInjectManyInjectable); - const higherOrderComponents = computedInjectMany( - reactApplicationHigherOrderComponentInjectionToken, - ); + const higherOrderComponents = computedInjectMany(reactApplicationHigherOrderComponentInjectionToken); const Components = [...higherOrderComponents.get(), ReactApplicationContent];