Skip to content

Commit 274e892

Browse files
authored
Enable new PSScriptAnalyzer option avoidSemicolonsAsLineTerminators (PowerShell#4164)
1 parent 17b5294 commit 274e892

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

extension-dev.code-workspace

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"MD024": false // no-duplicate-header
3737
},
3838
"powershell.codeFormatting.autoCorrectAliases": true,
39+
"powershell.codeFormatting.avoidSemicolonsAsLineTerminators": true,
3940
"powershell.codeFormatting.newLineAfterCloseBrace": false,
4041
"powershell.codeFormatting.trimWhitespaceAroundPipe": true,
4142
"powershell.codeFormatting.useCorrectCasing": true,

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,11 @@
676676
"default": false,
677677
"description": "Replaces aliases with their aliased name."
678678
},
679+
"powershell.codeFormatting.avoidSemicolonsAsLineTerminators": {
680+
"type": "boolean",
681+
"default": false,
682+
"description": "Removes redundant semicolon(s) at the end of a line where a line terminator is sufficient."
683+
},
679684
"powershell.codeFormatting.preset": {
680685
"type": "string",
681686
"enum": [

src/settings.ts

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface ICodeFoldingSettings {
4242

4343
export interface ICodeFormattingSettings {
4444
autoCorrectAliases: boolean;
45+
avoidSemicolonsAsLineTerminators: boolean;
4546
preset: CodeFormattingPreset;
4647
openBraceOnSameLine: boolean;
4748
newLineAfterOpenBrace: boolean;
@@ -173,6 +174,7 @@ export function load(): ISettings {
173174

174175
const defaultCodeFormattingSettings: ICodeFormattingSettings = {
175176
autoCorrectAliases: false,
177+
avoidSemicolonsAsLineTerminators: false,
176178
preset: CodeFormattingPreset.Custom,
177179
openBraceOnSameLine: true,
178180
newLineAfterOpenBrace: true,

0 commit comments

Comments
 (0)