diff --git a/src/common/ipc/ipc.ts b/src/common/ipc/ipc.ts index 0442d07630..cc339fd188 100644 --- a/src/common/ipc/ipc.ts +++ b/src/common/ipc/ipc.ts @@ -32,6 +32,7 @@ import type remote from "@electron/remote"; const electronRemote = (() => { if (ipcRenderer) { + /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */ try { return require("@electron/remote"); } catch {} diff --git a/src/renderer/components/+preferences/__tests__/extension-settings-page.test.tsx b/src/renderer/components/+preferences/__tests__/extension-settings-page.test.tsx index df93866464..3fbcc73877 100644 --- a/src/renderer/components/+preferences/__tests__/extension-settings-page.test.tsx +++ b/src/renderer/components/+preferences/__tests__/extension-settings-page.test.tsx @@ -40,8 +40,8 @@ const url = extensionSettingsURL({ const routeMatch: match<{ extensionId: string }> = { isExact: true, path: extensionSettingsRoute.path as string, - url: url, - params: { extensionId: "@k8slens/crd-example" } + url, + params: { extensionId: "@k8slens/crd-example" }, }; const location = createLocation(routeMatch.url); @@ -56,7 +56,7 @@ const crdExtension = { isBundled: false, isEnabled: true, isCompatible: true, -} +}; const sampleExtension = { id: "/absolute/path/sample", @@ -69,7 +69,7 @@ const sampleExtension = { isBundled: false, isEnabled: true, isCompatible: true, -} +}; describe("", () => { let di: ConfigurableDependencyInjectionContainer; @@ -84,7 +84,7 @@ describe("", () => { { components: { Input: () => , - Hint: () =>
choose crd name
+ Hint: () =>
choose crd name
, }, extensionId: "@k8slens/crd-example", title: "CRD Preferences", @@ -92,7 +92,7 @@ describe("", () => { { components: { Input: () => , - Hint: () =>
save to file
+ Hint: () =>
save to file
, }, extensionId: "@k8slens/crd-example", title: "Filesystem", @@ -102,11 +102,11 @@ describe("", () => { { components: { Input: () => , - Hint: () =>
sample hint
+ Hint: () =>
sample hint
, }, extensionId: "@k8slens/sample", title: "Sample preferences", - } + }, ], new LensExtension(sampleExtension)); }); @@ -154,4 +154,4 @@ describe("", () => { expect(getByText("No extension id provided in URL")).toBeInTheDocument(); }); -}); \ No newline at end of file +}); diff --git a/src/renderer/components/+preferences/__tests__/preferences.test.tsx b/src/renderer/components/+preferences/__tests__/preferences.test.tsx index 9008a5e131..406acc1533 100644 --- a/src/renderer/components/+preferences/__tests__/preferences.test.tsx +++ b/src/renderer/components/+preferences/__tests__/preferences.test.tsx @@ -42,7 +42,7 @@ const extension = { isBundled: false, isEnabled: true, isCompatible: true, -} +}; const crdExtension = { id: "/absolute/path/crd", @@ -55,7 +55,7 @@ const crdExtension = { isBundled: false, isEnabled: true, isCompatible: true, -} +}; const sampleExtension = { id: "/absolute/path/sample", @@ -68,7 +68,7 @@ const sampleExtension = { isBundled: false, isEnabled: true, isCompatible: true, -} +}; describe("Preferences", () => { let di: ConfigurableDependencyInjectionContainer; @@ -83,33 +83,33 @@ describe("Preferences", () => { { components: { Input: () =>
input
, - Hint: () =>
hint
+ Hint: () =>
hint
, }, extensionId: "@k8slens/test", id: "example-preferences", title: "Example Preferences", - } + }, ], new LensExtension(extension)); AppPreferenceRegistry.getInstance().add([ { components: { Input: () =>
crd input
, - Hint: () =>
crd hint
+ Hint: () =>
crd hint
, }, extensionId: "@k8slens/crd-example", title: "Example Preferences", - } + }, ], new LensExtension(crdExtension)); AppPreferenceRegistry.getInstance().add([ { components: { Input: () =>
sample input
, - Hint: () =>
sample hint
+ Hint: () =>
sample hint
, }, extensionId: "@k8slens/crd-example", title: "Extension with duplicated name", - } - ], new LensExtension(crdExtension)) + }, + ], new LensExtension(crdExtension)); }); afterEach(() => { @@ -137,7 +137,7 @@ describe("Preferences", () => { const { getByTestId } = render(); expect(getByTestId("custom-settings")).toBeInTheDocument(); - }) + }); it("renders tabs for each extension having custom settings", () => { di.override(userExtensionsInjectable, () => { @@ -159,6 +159,6 @@ describe("Preferences", () => { const { getAllByText } = render(); expect(getAllByText("@k8slens/crd-example").length).toBe(1); - }) + }); }); }); diff --git a/src/renderer/components/+preferences/index.tsx b/src/renderer/components/+preferences/index.tsx deleted file mode 100644 index 11ee65ea78..0000000000 --- a/src/renderer/components/+preferences/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2021 OpenLens Authors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -export * from "./preferences";