Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,19 @@ All boolean, string, and integer [`bsfmt.json`](#bsfmtjson-options) options are
|formatInteriorWhitespace|`boolean`|`true`| All whitespace between items is reduced to exactly 1 space character and certain keywords and operators are padded with whitespace. This is a catchall property that will also disable the following rules: `insertSpaceBeforeFunctionParenthesis`, `insertSpaceBetweenEmptyCurlyBraces` `insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces`|
|insertSpaceBeforeFunctionParenthesis|`boolean`|`false`| If true, a space is inserted to the left of an opening function declaration parenthesis. (i.e. `function main ()` or `function ()`). If false, all spacing is removed (i.e. `function main()` or `function()`).|
|insertSpaceBetweenEmptyCurlyBraces|`boolean`|`false`| If true, empty curly braces will contain exactly 1 whitespace char (i.e. `{ }`). If false, there will be zero whitespace chars between empty curly braces (i.e. `{}`) |
|insertSpaceAfterConditionalCompileSymbol|`boolean`|`false`| If true, ensure exactly 1 space between `#` and the keyword (i.e. `# if true`). If false, remove all whitespace between `#` and the keyword (i.e. `#if true`)|
|insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces|`boolean`|`true`| If true, ensure exactly 1 space after leading and before trailing curly braces. If false, REMOVE all whitespace after leading and before trailing curly braces (excluding beginning-of-line indentation spacing)|
|insertSpaceBetweenAssociativeArrayLiteralKeyAndColon|`boolean`|`false`| If true, ensure exactly 1 space between an associative array literal key and its colon. If false, all space between the key and its colon will be removed |
|formatSingleLineCommentType|`"singlequote", "rem", "original"`| `"original"` | Forces all single-line comments to use the same style. If 'singlequote' or falsey, all comments are preceeded by a single quote. This is the default. If `"rem"`, all comments are preceeded by `rem`. If `"original"`, the comment type is unchanged|
|formatMultiLineObjectsAndArrays|`boolean`| `true`|For multi-line objects and arrays, move everything after the `{` or `[` and everything before the `}` or `]` onto a new line.`|
|sortImports|`boolean`| `false`|Sort imports alphabetically.`|
|trailingComma| `"always", "allButLast", "never", "original"` | `"original"` | Controls commas on items of multi-line arrays and associative arrays. `"always"`: every item gets a trailing comma (including the last). `"allButLast"`: every item except the last gets a comma (conventional style). `"never"`: all item commas are removed. `"original"`: commas are not modified. Has no effect on single-line arrays or AAs.|
|maxConsecutiveEmptyLines|`number`|`undefined`| Collapse runs of consecutive blank lines down to at most this many. For example, `1` collapses three blank lines in a row into one. When omitted, blank lines are not modified.|
|blankLinesBetweenFunctions|`number`|`undefined`| Ensures exactly this many blank lines between consecutive top-level `function`/`sub` declarations. When omitted, spacing between functions is not modified.|
|singleLineIf|`"collapse", "expand", "original"`|`"original"`| Controls how single-statement `if` blocks are formatted. `"collapse"`: convert a multi-line if with a single statement and no else to an inline if (e.g. `if x then y = 1`). `"expand"`: convert an inline if to a multi-line block with `end if`. `"original"`: leave if statements unchanged.|
|inlineArrayAndObjectThreshold|`number`|`0`| If set to a positive number, multi-line arrays and associative arrays whose inline representation fits within this many characters will be collapsed to a single line. Set to `0` or omit to disable.|
|removeBlankLinesAtStartOfBlock|`boolean`|`false`| If true, remove blank lines immediately after the opening of a block (`function`/`sub` body, `if`/`for`/`while` blocks, etc.).|
|alignAssignments|`boolean`|`false`| If true, align the `=` sign in consecutive simple assignment statements by padding the left-hand side with spaces. Alignment resets after a blank line or a non-assignment statement.|
|sortImports|`boolean`| `false`|Sort imports alphabetically.|

### keywordCaseOverride
For more flexibility in how to format the case of keywords, you can specify the case preference for each individual keyword. Here's an example:
Expand Down
Loading