Enable no-case-declarations in codebase (#139243)

Fixes #139236

This can catch tricky programming mistakes that cause a runtime error. See 7e266b2c42 as an example of the type of bug this can prevent
This commit is contained in:
Matt Bierner
2021-12-15 17:15:35 -08:00
committed by GitHub
parent f589173345
commit e7b3724e0c
68 changed files with 233 additions and 158 deletions

View File

@@ -2821,7 +2821,7 @@ export class CommandCenter {
type = 'warning';
options.modal = false;
break;
case GitErrorCodes.AuthenticationFailed:
case GitErrorCodes.AuthenticationFailed: {
const regex = /Authentication failed for '(.*)'/i;
const match = regex.exec(err.stderr || String(err));
@@ -2829,12 +2829,13 @@ export class CommandCenter {
? localize('auth failed specific', "Failed to authenticate to git remote:\n\n{0}", match[1])
: localize('auth failed', "Failed to authenticate to git remote.");
break;
}
case GitErrorCodes.NoUserNameConfigured:
case GitErrorCodes.NoUserEmailConfigured:
message = localize('missing user info', "Make sure you configure your 'user.name' and 'user.email' in git.");
choices.set(localize('learn more', "Learn More"), () => commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup')));
break;
default:
default: {
const hint = (err.stderr || err.message || String(err))
.replace(/^error: /mi, '')
.replace(/^> husky.*$/mi, '')
@@ -2847,6 +2848,7 @@ export class CommandCenter {
: localize('git error', "Git error");
break;
}
}
if (!message) {