diff --git a/src/content/hinting.ts b/src/content/hinting.ts index a4205263..2f94652c 100644 --- a/src/content/hinting.ts +++ b/src/content/hinting.ts @@ -178,12 +178,10 @@ function defaultHintFilter() { } function defaultHintChars() { - switch (config.get("hintnames")) { - case "numeric": - return "1234567890" - default: - return config.get("hintchars") + if (config.get("hintnames") == "numeric") { + return "1234567890" } + return config.get("hintchars") } /** An infinite stream of hints diff --git a/src/excmds.ts b/src/excmds.ts index 16186f97..14f61326 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -3909,22 +3909,13 @@ export async function ttsvoices() { */ //#content export async function ttscontrol(action: string) { - let ttsAction: TTS.Action = null - - // convert user input to TTS.Action // only pause seems to be working, so only provide access to that // to avoid exposing users to things that won't work - switch (action) { - case "stop": - ttsAction = "stop" - break - } - - if (ttsAction) { - TTS.doAction(ttsAction) - } else { + if (action != "stop") { throw new Error("Unknown text-to-speech action: " + action) } + + TTS.doAction(action as TTS.Action) } //}}} diff --git a/tslint.json b/tslint.json index 022034a8..9a301f13 100644 --- a/tslint.json +++ b/tslint.json @@ -28,7 +28,6 @@ "no-misleading-array-reverse": false, "no-self-assignment": false, "no-shadowed-variable": false, - "no-small-switch": false, "no-string-literal": false, "no-string-throw": false, "no-trailing-whitespace": false,