Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tadaskay committed May 25, 2020
1 parent 79ab383 commit eea4f3f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/analytics/analytics-main.ts
Expand Up @@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

/* eslint-disable @typescript-eslint/ban-ts-ignore */
import ua from "universal-analytics"
import { App, BrowserWindow, screen } from "electron"
import { machineIdSync } from "node-machine-id"
Expand Down Expand Up @@ -46,11 +45,8 @@ export const initialize = (): void => {
}

export const setupGlobals = (): void => {
// @ts-ignore
global.analyticsSetUserId = analytics.setUserId
// @ts-ignore
global.analyticsEvent = analytics.event
// @ts-ignore
global.analyticsPageview = analytics.pageview
}

Expand Down
6 changes: 0 additions & 6 deletions src/main/index.tsx
Expand Up @@ -30,15 +30,11 @@ initializeSentry()

const isDevelopment = process.env.NODE_ENV !== "production"

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
global.supervisor = supervisor

// global reference to win (necessary to prevent window from being garbage collected)
let win: BrowserWindow | null

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let tray: Tray | null

Expand Down Expand Up @@ -137,8 +133,6 @@ app.on("activate", async () => {
}
})

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
app.on("before-quit", () => (app.quitting = true))

app.on("will-quit", async () => {
Expand Down
21 changes: 21 additions & 0 deletions src/typings/globals.d.ts
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2020 BlockDev AG
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { Supervisor } from "../supervisor/supervisor"
// eslint-disable-next-line no-restricted-imports,@typescript-eslint/no-unused-vars
import type { analytics } from "../analytics/analytics-main"

declare global {
namespace NodeJS {
interface Global extends NodeJS.Global {
supervisor: Supervisor
analyticsSetUserId: typeof analytics.setUserId
analyticsEvent: typeof analytics.event
analyticsPageview: typeof analytics.pageview
}
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ui-kit/toggle/nav-toggle.tsx
Expand Up @@ -11,7 +11,7 @@ export interface ToggleProps {
small?: boolean
children: React.ReactNode
active: boolean
onClick: Function
onClick: () => void
}

export const NavToggle = styled.div<ToggleProps>`
Expand Down
2 changes: 1 addition & 1 deletion src/utils/on-process-exit.ts
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export const onProcessExit = (hook: Function): void => {
export const onProcessExit = (hook: () => void): void => {
const shutdown = (): void => {
console.log("Shutting down...")
hook()
Expand Down

0 comments on commit eea4f3f

Please sign in to comment.