Skip to content

Commit

Permalink
docs: Add real whitespace to no-trailing-spaces examples (#17630)
Browse files Browse the repository at this point in the history
* Add real whitespace to `no-trailing-spaces` examples

* Fix space-only line
  • Loading branch information
fasttime authored Oct 9, 2023
1 parent 1000187 commit 6b8acfb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docs/src/rules/no-trailing-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Examples of **incorrect** code for this rule:
```js
/*eslint no-trailing-spaces: "error"*/

var foo = 0;//•••••
var baz = 5;//••
//•••••
var foo = 0;/* trailing whitespace */
var baz = 5;/* trailing whitespace */
/* trailing whitespace */
```

:::
Expand Down Expand Up @@ -58,7 +58,8 @@ Examples of **correct** code for this rule with the `{ "skipBlankLines": true }`

var foo = 0;
var baz = 5;
//•••••
// ↓ a line with whitespace only ↓

```

:::
Expand All @@ -72,12 +73,12 @@ Examples of **correct** code for this rule with the `{ "ignoreComments": true }`
```js
/*eslint no-trailing-spaces: ["error", { "ignoreComments": true }]*/

//foo•
//•••••
// ↓ these comments have trailing whitespace →
//
/**
*baz
*••
*bar
* baz
*
* bar
*/
```

Expand Down

0 comments on commit 6b8acfb

Please sign in to comment.