summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-02-19 15:59:50 +0100
committerOskar Nyberg <oskar@mullvad.net>2020-02-19 15:59:50 +0100
commite2eb2c6a40de00fd19d3d9a337b268580535d4c3 (patch)
treef6c09b7e2fb0349f3e91449e849eb305504b6c09 /gui/src/shared
parent937cd41dc54d9426e8970f6d83ead110817c27e7 (diff)
parenta423058d74447fb9f24d12631d644b7cd597a517 (diff)
downloadmullvadvpn-e2eb2c6a40de00fd19d3d9a337b268580535d4c3.tar.xz
mullvadvpn-e2eb2c6a40de00fd19d3d9a337b268580535d4c3.zip
Merge branch 'fix-lint-no-explicit-any'
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/gettext.ts2
-rw-r--r--gui/src/shared/ipc-event-channel.ts6
2 files changed, 8 insertions, 0 deletions
diff --git a/gui/src/shared/gettext.ts b/gui/src/shared/gettext.ts
index e98a38ac33..5f33190109 100644
--- a/gui/src/shared/gettext.ts
+++ b/gui/src/shared/gettext.ts
@@ -22,6 +22,7 @@ export function loadTranslations(currentLocale: string, catalogue: Gettext) {
}
// NOTE: domain is not publicly exposed
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const domain = (catalogue as any).domain;
for (const locale of preferredLocales) {
@@ -67,6 +68,7 @@ function parseTranslation(locale: string, domain: string, catalogue: Gettext): b
function setErrorHandler(catalogue: Gettext) {
catalogue.on('error', (error) => {
// NOTE: locale is not publicly exposed
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const catalogueLocale = (catalogue as any).locale;
// Filter out the "no translation was found" errors for the source language.
diff --git a/gui/src/shared/ipc-event-channel.ts b/gui/src/shared/ipc-event-channel.ts
index 5502a6698a..c01c8ced89 100644
--- a/gui/src/shared/ipc-event-channel.ts
+++ b/gui/src/shared/ipc-event-channel.ts
@@ -425,6 +425,8 @@ function handler<T>(event: string): (handlerFn: (value: T) => void) => void {
type RequestResult<T> = { type: 'success'; value: T } | { type: 'error'; message: string };
+// The Elector API uses the `any` type.
+/* eslint-disable @typescript-eslint/no-explicit-any */
function requestHandler<T>(event: string): (fn: (...args: any[]) => Promise<T>) => void {
return (fn: (...args: any[]) => Promise<T>) => {
ipcMain.on(
@@ -452,7 +454,10 @@ function requestHandler<T>(event: string): (fn: (...args: any[]) => Promise<T>)
);
};
}
+/* eslint-enable @typescript-eslint/no-explicit-any */
+// The Elector API uses the `any` type.
+/* eslint-disable @typescript-eslint/no-explicit-any */
function requestSender<T>(event: string): (...args: any[]) => Promise<T> {
return (...args: any[]): Promise<T> => {
return new Promise((resolve: (result: T) => void, reject: (error: Error) => void) => {
@@ -478,3 +483,4 @@ function requestSender<T>(event: string): (...args: any[]) => Promise<T> {
});
};
}
+/* eslint-enable @typescript-eslint/no-explicit-any */