2 title: no-trailing-spaces
9 Sometimes in the course of editing files, you can end up with extra whitespace at the end of lines. These whitespace differences can be picked up by source control systems and flagged as diffs, causing frustration for developers. While this extra whitespace causes no functional issues, many code conventions require that trailing spaces be removed before check-in.
13 This rule disallows trailing whitespace (spaces, tabs, and other Unicode whitespace characters) at the end of lines.
15 Examples of **incorrect** code for this rule:
20 /*eslint no-trailing-spaces: "error"*/
29 Examples of **correct** code for this rule:
34 /*eslint no-trailing-spaces: "error"*/
44 This rule has an object option:
46 * `"skipBlankLines": false` (default) disallows trailing whitespace on empty lines
47 * `"skipBlankLines": true` allows trailing whitespace on empty lines
48 * `"ignoreComments": false` (default) disallows trailing whitespace in comment blocks
49 * `"ignoreComments": true` allows trailing whitespace in comment blocks
53 Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` option:
58 /*eslint no-trailing-spaces: ["error", { "skipBlankLines": true }]*/
69 Examples of **correct** code for this rule with the `{ "ignoreComments": true }` option:
74 /*eslint no-trailing-spaces: ["error", { "ignoreComments": true }]*/