xo: Enable @typescript-eslint/restrict-template-expressions.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-04-25 16:53:33 -07:00
committed by Anders Kaseorg
parent fc6ff83485
commit 849df4adaf
6 changed files with 22 additions and 9 deletions

View File

@@ -45,6 +45,16 @@ export function getConfigItem(key: string, defaultValue: any = null): any {
}
}
export function getConfigString(key: string, defaultValue: string): string {
const value = getConfigItem(key, defaultValue);
if (typeof value === 'string') {
return value;
} else {
setConfigItem(key, defaultValue);
return defaultValue;
}
}
// This function returns whether a key exists in the configuration file (settings.json)
export function isConfigItemExists(key: string): boolean {
try {