This extension helps to identify and remove trailing whitespace. It includes the following features:
-
If you hit Enter on a line that has trailing whitespace, it will be automatically removed.
-
If you hit Enter before whitespace on a line, the whitespace will be removed.
Example: The
|
character represents the cursor position.$arr = [ 1, 2,| 3, 4 ];
Hitting Enter without Extension
$arr = [ 1, 2, | 3, 4 ];
Hitting Enter with Extension
$arr = [ 1, 2, |3, 4 ];
- Any trailing whitespace on lines other than the current line will be highlighted in red.
- If you want to allow lines that are only whitespace, you can enable the
trailing-whitespace-fixer.allowWhitespaceOnlyLines
setting. This is useful if you want to retain the current indentation level.