diff --git a/extensions/json/client/src/jsonMain.ts b/extensions/json/client/src/jsonMain.ts index 36868a319b65a3eae20ac600474f08f4a27cbc5f..9491dc03e3e08da697531ddcc8d7eb27a4559ba4 100644 --- a/extensions/json/client/src/jsonMain.ts +++ b/extensions/json/client/src/jsonMain.ts @@ -42,8 +42,8 @@ interface Settings { format?: { enable: boolean; }; }; http?: { - proxy: string; - proxyStrictSSL: boolean; + proxy?: string; + proxyStrictSSL?: boolean; }; } @@ -53,7 +53,7 @@ interface JSONSchemaSettings { schema?: any; } -let telemetryReporter: TelemetryReporter; +let telemetryReporter: TelemetryReporter | undefined; export function activate(context: ExtensionContext) { @@ -197,14 +197,14 @@ function getSettings(): Settings { let schemaSetting = schemaSettingsById[url]; if (!schemaSetting) { schemaSetting = schemaSettingsById[url] = { url, fileMatch: [] }; - settings.json.schemas.push(schemaSetting); + settings.json!.schemas!.push(schemaSetting); } let fileMatches = setting.fileMatch; if (Array.isArray(fileMatches)) { if (fileMatchPrefix) { fileMatches = fileMatches.map(m => fileMatchPrefix + m); } - schemaSetting.fileMatch.push(...fileMatches); + schemaSetting.fileMatch!.push(...fileMatches); } if (setting.schema) { schemaSetting.schema = setting.schema; @@ -222,7 +222,7 @@ function getSettings(): Settings { for (let folder of folders) { let folderUri = folder.uri; let schemaConfigInfo = workspace.getConfiguration('json', folderUri).inspect('schemas'); - let folderSchemas = schemaConfigInfo.workspaceFolderValue; + let folderSchemas = schemaConfigInfo!.workspaceFolderValue; if (Array.isArray(folderSchemas)) { let folderPath = folderUri.toString(); if (folderPath[folderPath.length - 1] !== '/') { @@ -247,7 +247,7 @@ function getSchemaId(schema: JSONSchemaSettings, rootPath?: string) { return url; } -function getPackageInfo(context: ExtensionContext): IPackageInfo { +function getPackageInfo(context: ExtensionContext): IPackageInfo | undefined { let extensionPackage = require(context.asAbsolutePath('./package.json')); if (extensionPackage) { return { @@ -256,5 +256,5 @@ function getPackageInfo(context: ExtensionContext): IPackageInfo { aiKey: extensionPackage.aiKey }; } - return null; + return void 0; } diff --git a/extensions/json/client/tsconfig.json b/extensions/json/client/tsconfig.json index 3a99c6f937eecdf2b37c92b161633d48021f2cfa..494973432eff8f54a7044871cafc2337ff818da9 100644 --- a/extensions/json/client/tsconfig.json +++ b/extensions/json/client/tsconfig.json @@ -4,6 +4,7 @@ "module": "commonjs", "outDir": "./out", "noUnusedLocals": true, - "lib": [ "es2016" ] + "lib": [ "es2016" ], + "strict": true } } \ No newline at end of file