From 36d91612a83f0403d6350cec479b67c27c2ad364 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Mon, 5 Sep 2022 09:58:33 +0100 Subject: [PATCH] Enable new PSScriptAnalyzer option `avoidSemicolonsAsLineTerminators` --- extension-dev.code-workspace | 1 + package.json | 5 +++++ src/settings.ts | 2 ++ 3 files changed, 8 insertions(+) diff --git a/extension-dev.code-workspace b/extension-dev.code-workspace index 722bac94df..9a451c5dcb 100644 --- a/extension-dev.code-workspace +++ b/extension-dev.code-workspace @@ -36,6 +36,7 @@ "MD024": false // no-duplicate-header }, "powershell.codeFormatting.autoCorrectAliases": true, + "powershell.codeFormatting.avoidSemicolonsAsLineTerminators": true, "powershell.codeFormatting.newLineAfterCloseBrace": false, "powershell.codeFormatting.trimWhitespaceAroundPipe": true, "powershell.codeFormatting.useCorrectCasing": true, diff --git a/package.json b/package.json index 669cf22048..bf3eebe535 100644 --- a/package.json +++ b/package.json @@ -676,6 +676,11 @@ "default": false, "description": "Replaces aliases with their aliased name." }, + "powershell.codeFormatting.avoidSemicolonsAsLineTerminators": { + "type": "boolean", + "default": false, + "description": "Removes redundant semicolon(s) at the end of a line where a line terminator is sufficient." + }, "powershell.codeFormatting.preset": { "type": "string", "enum": [ diff --git a/src/settings.ts b/src/settings.ts index 8378d0437f..9d7687a3ae 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -42,6 +42,7 @@ export interface ICodeFoldingSettings { export interface ICodeFormattingSettings { autoCorrectAliases: boolean; + avoidSemicolonsAsLineTerminators: boolean; preset: CodeFormattingPreset; openBraceOnSameLine: boolean; newLineAfterOpenBrace: boolean; @@ -173,6 +174,7 @@ export function load(): ISettings { const defaultCodeFormattingSettings: ICodeFormattingSettings = { autoCorrectAliases: false, + avoidSemicolonsAsLineTerminators: false, preset: CodeFormattingPreset.Custom, openBraceOnSameLine: true, newLineAfterOpenBrace: true,