strict null for contrib/preferences and contrib/configuration (#11915)

This commit is contained in:
Anthony Dresser
2020-08-21 15:51:29 -07:00
committed by GitHub
parent 061052e4f3
commit faff61bb82
3 changed files with 4 additions and 9 deletions

View File

@@ -31,8 +31,8 @@ const settingsToMove: { [key: string]: string } = deepFreeze({
export class ConfigurationUpgraderContribution implements IWorkbenchContribution {
private static readonly STORAGE_KEY = 'configurationUpgrader';
private readonly globalStorage: { [key: string]: boolean };
private readonly workspaceStorage: { [key: string]: boolean };
private readonly globalStorage: { [key: string]: boolean } = JSON.parse(this.storageService.get(ConfigurationUpgraderContribution.STORAGE_KEY, StorageScope.GLOBAL, '{}'));
private readonly workspaceStorage: { [key: string]: boolean } = JSON.parse(this.storageService.get(ConfigurationUpgraderContribution.STORAGE_KEY, StorageScope.WORKSPACE, '{}'));
public readonly processingPromise: Promise<void>;
@@ -41,8 +41,6 @@ export class ConfigurationUpgraderContribution implements IWorkbenchContribution
@IConfigurationService private readonly configurationService: IConfigurationService,
@INotificationService private readonly notificationService: INotificationService
) {
this.globalStorage = JSON.parse(this.storageService.get(ConfigurationUpgraderContribution.STORAGE_KEY, StorageScope.GLOBAL, '{}'));
this.workspaceStorage = JSON.parse(this.storageService.get(ConfigurationUpgraderContribution.STORAGE_KEY, StorageScope.WORKSPACE, '{}'));
this.processingPromise = (async () => {
await this.processSettings();
this.storageService.store(ConfigurationUpgraderContribution.STORAGE_KEY, JSON.stringify(this.globalStorage), StorageScope.GLOBAL);

View File

@@ -5,10 +5,9 @@
import { localize } from 'vs/nls';
import { tocData as vstocData, ITOCEntry } from 'vs/workbench/contrib/preferences/browser/settingsLayout';
import { assign } from 'vs/base/common/objects';
// Copy existing table of contents and append
export const tocData: ITOCEntry = assign({}, vstocData);
export const tocData: ITOCEntry = Object.assign({}, vstocData);
let sqlTocItems: ITOCEntry[] = [{
id: 'data',
label: localize('data', "Data"),
@@ -40,4 +39,4 @@ let sqlTocItems: ITOCEntry[] = [{
}
]
}];
tocData.children.push(...sqlTocItems);
tocData.children!.push(...sqlTocItems);

View File

@@ -37,7 +37,6 @@
"./sql/workbench/contrib/backup/**/*.ts", // 249 errors
"./sql/workbench/contrib/charts/**/*.ts", // 3253 errors
"./sql/workbench/contrib/commandLine/**/*.ts", // 3276 errors
"./sql/workbench/contrib/configuration/**/*.ts", // 2 errors
"./sql/workbench/contrib/connection/**/*.ts", // 355 errors
"./sql/workbench/contrib/dashboard/**/*.ts", // 1292 errors
"./sql/workbench/contrib/dataExplorer/**/*.ts", // 3275 errors
@@ -48,7 +47,6 @@
"./sql/workbench/contrib/modelView/**/*.ts", // 3253 errors
"./sql/workbench/contrib/notebook/**/*.ts", // 3740 errors
"./sql/workbench/contrib/objectExplorer/**/*.ts", // 3330 errors
"./sql/workbench/contrib/preferences/**/*.ts", // 1 errors
"./sql/workbench/contrib/profiler/**/*.ts", // 204 errors
"./sql/workbench/contrib/query/**/*.ts", // 3342 errors
"./sql/workbench/contrib/queryHistory/**/*.ts", // 432 errors