Tags: `whitespace`Aliases: `no-trailing-spaces`Parameters:`br_spaces`: Spaces for line break (`integer`, default `2`)`list_item_empty_lines`: Allow spaces for empty lines in list items (`boolean`, default `false`)`strict`: Include unnecessary breaks (`boolean`, default `false`)Fixable: Some violations can be fixed by toolingThis rule is triggered on any lines that end with unexpected whitespace. To fixthis, remove the trailing space from the end of the line.Note: Trailing space is allowed in indented and fenced code blocks because somelanguages require it.The `br_spaces` parameter allows an exception to this rule for a specific numberof trailing spaces, typically used to insert an explicit line break. The defaultvalue allows 2 spaces to indicate a hard break (\<br> element).Note: You must set `br_spaces` to a value >= 2 for this parameter to takeeffect. Setting `br_spaces` to 1 behaves the same as 0, disallowing any trailingspaces.By default, this rule will not trigger when the allowed number of spaces isused, even when it doesn't create a hard break (for example, at the end of aparagraph). To report such instances as well, set the `strict` parameter to`true`.Text text text text[2 spaces] Using spaces to indent blank lines inside a list item is usually not necessary,but some parsers require it. Set the `list_item_empty_lines` parameter to `true`to allow this (even when `strict` is `true`):- list item text [2 spaces] list item text Rationale: Except when being used to create a line break, trailing whitespacehas no purpose and does not affect the rendering of content.

发表评论 取消回复