Skip to content

Commit 50b2719

Browse files
committed
do something nice for typescript
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent cfaa48b commit 50b2719

20 files changed

+47
-32
lines changed

src/actions/onActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import logger from '../services/logger'
99

1010
interface SetupActions {
1111
actions: TT.StepActions
12-
send: (action: T.Action) => void // send messages to client
12+
send: T.Send
1313
dir?: string
1414
}
1515

src/actions/onErrorPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as T from 'typings'
22
import { readFile } from '../services/node'
33
import logger from '../services/logger'
44

5-
const onErrorPage = async (action: T.Action): void => {
5+
const onErrorPage = async (action: T.Action): Promise<void> => {
66
// Error middleware
77
if (action?.payload?.error?.type) {
88
// load error markdown message

src/actions/onOpenLogs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as T from 'typings'
22
import { showOutput } from '../services/testRunner/output'
33

4-
export const onOpenLogs = async (action: T.Action): void => {
4+
export const onOpenLogs = async (action: T.Action): Promise<void> => {
55
const channel = action.payload.channel
66
await showOutput(channel)
77
}

src/actions/onRunReset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type ResetAction = {
1111
}
1212

1313
// reset to the start of the last test
14-
const onRunReset = async (action: ResetAction, context: Context): void => {
14+
const onRunReset = async (action: ResetAction, context: Context): Promise<void> => {
1515
// reset to timeline
1616
const tutorial: TT.Tutorial | null = context.tutorial.get()
1717
const position: T.Position = action.position ? action.position : context.position.get()

src/actions/onStartup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const onStartup = async (
1111
context: Context,
1212
workspaceState: vscode.Memento,
1313
send: (action: T.Action) => Promise<void>,
14-
): void => {
14+
): Promise<void> => {
1515
try {
1616
// check if a workspace is open, otherwise nothing works
1717
const noActiveWorkspace = !WORKSPACE_ROOT.length

src/actions/onTutorialConfigContinue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Context from '../services/context/context'
55
import tutorialConfig from './utils/tutorialConfig'
66
import { COMMANDS } from '../commands'
77

8-
const onTutorialConfigContinue = async (action: T.Action, context: Context, send: T.Send): void => {
8+
const onTutorialConfigContinue = async (action: T.Action, context: Context, send: T.Send): Promise<void> => {
99
try {
1010
const tutorialContinue: TT.Tutorial | null = context.tutorial.get()
1111
if (!tutorialContinue) {

src/actions/onTutorialConfigNew.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { version, compareVersions } from '../services/dependencies'
88
import Context from '../services/context/context'
99
import tutorialConfig from './utils/tutorialConfig'
1010

11-
const onTutorialConfigNew = async (action: T.Action, context: Context, send: T.Send): void => {
11+
const onTutorialConfigNew = async (action: T.Action, context: Context, send: T.Send): Promise<void> => {
1212
try {
1313
const data: TT.Tutorial = action.payload.tutorial
1414

src/actions/onValidateSetup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import * as T from 'typings'
12
import * as E from 'typings/error'
23
import { version } from '../services/dependencies'
34
import { checkWorkspaceEmpty } from '../services/workspace'
45

5-
const onValidateSetup = async (send: T.Send): void => {
6+
const onValidateSetup = async (send: T.Send): Promise<void> => {
67
try {
78
// check workspace is selected
89
const isEmptyWorkspace = await checkWorkspaceEmpty()

src/actions/utils/loadWatchers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const disposeWatcher = (watcher: string) => {
1414
delete watcherObject[watcher]
1515
}
1616

17-
const loadWatchers = (watchers: string[]) => {
17+
const loadWatchers = (watchers: string[]): void => {
1818
if (!watchers.length) {
1919
// remove all watchers
2020
for (const watcher of Object.keys(watcherObject)) {

src/actions/utils/openFiles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { join } from 'path'
22
import * as vscode from 'vscode'
33
import { COMMANDS } from '../../commands'
44

5-
const openFiles = async (files: string[]) => {
5+
const openFiles = async (files: string[]): Promise<void> => {
66
if (!files.length) {
77
return
88
}

0 commit comments

Comments
 (0)