Add more files to strict compile. Update CONTRIBUTING.md (#63)

* Add more files to strict compile. Update CONTRIBUTING.md to recommend FluentUI use

* Remove eslint-disable and use non-null assertion
This commit is contained in:
Laurent Nguyen
2020-07-06 17:16:24 +02:00
committed by GitHub
parent c51a55013c
commit 3f34936acd
12 changed files with 48 additions and 37 deletions

View File

@@ -5,7 +5,7 @@ export class LocalStorageUtility {
return !!localStorage.getItem(StorageKey[key]);
}
public static getEntryString(key: StorageKey): string {
public static getEntryString(key: StorageKey): string | null {
return localStorage.getItem(StorageKey[key]);
}
@@ -39,7 +39,7 @@ export class SessionStorageUtility {
return !!sessionStorage.getItem(StorageKey[key]);
}
public static getEntryString(key: StorageKey): string {
public static getEntryString(key: StorageKey): string | null {
return sessionStorage.getItem(StorageKey[key]);
}

View File

@@ -1,9 +1,9 @@
export class StringUtility {
public static toNumber(num: string): number {
public static toNumber(num: string | null): number {
return Number(num);
}
public static toBoolean(valueStr: string): boolean {
public static toBoolean(valueStr: string | null): boolean {
return valueStr === "true";
}
}

View File

@@ -82,33 +82,35 @@ export default class TelemetryProcessor {
}
public static traceOpen(action: Action, data?: any, timestamp?: number): number {
const validTimestamp = timestamp || Date.now();
MessageHandler.sendMessage({
type: MessageTypes.TelemetryInfo,
data: {
action: Action[action],
actionModifier: ActionModifiers.Open,
timestamp: timestamp || Date.now(),
timestamp: validTimestamp,
data: JSON.stringify(data)
}
});
appInsights.startTrackEvent(Action[action]);
return timestamp;
return validTimestamp;
}
public static traceMark(action: Action, data?: any, timestamp?: number): number {
const validTimestamp = timestamp || Date.now();
MessageHandler.sendMessage({
type: MessageTypes.TelemetryInfo,
data: {
action: Action[action],
actionModifier: ActionModifiers.Mark,
timestamp: timestamp || Date.now(),
timestamp: validTimestamp,
data: JSON.stringify(data)
}
});
appInsights.startTrackEvent(Action[action]);
return timestamp;
return validTimestamp;
}
private static getData(data?: any): any {