Marking a bunch of static variables as readonly

Readonly helps out with TS's type guards and is also a good best practice. Specifically, readonly strings/numbers have their literal type instead of a generic `string` | `number` type, which can help catch dead code and some common programming mistakes
This commit is contained in:
Matt Bierner
2019-10-07 15:39:21 -07:00
parent 90f33ddc6d
commit b0dccbcf75
90 changed files with 217 additions and 217 deletions

View File

@@ -103,10 +103,10 @@ class LocalStorageCredentialsProvider implements ICredentialsProvider {
class PollingURLCallbackProvider extends Disposable implements IURLCallbackProvider {
static FETCH_INTERVAL = 500; // fetch every 500ms
static FETCH_TIMEOUT = 5 * 60 * 1000; // ...but stop after 5min
static readonly FETCH_INTERVAL = 500; // fetch every 500ms
static readonly FETCH_TIMEOUT = 5 * 60 * 1000; // ...but stop after 5min
static QUERY_KEYS = {
static readonly QUERY_KEYS = {
REQUEST_ID: 'vscode-requestId',
SCHEME: 'vscode-scheme',
AUTHORITY: 'vscode-authority',

View File

@@ -13,7 +13,7 @@ import { IBackupWorkspacesFormat } from 'vs/platform/backup/node/backup';
export class StorageDataCleaner extends Disposable {
// Workspace/Folder storage names are MD5 hashes (128bits / 4 due to hex presentation)
private static NON_EMPTY_WORKSPACE_ID_LENGTH = 128 / 4;
private static readonly NON_EMPTY_WORKSPACE_ID_LENGTH = 128 / 4;
constructor(
@IEnvironmentService private readonly environmentService: IEnvironmentService