Skip to content

Commit 6b8acfb

Browse files
authoredOct 9, 2023
docs: Add real whitespace to no-trailing-spaces examples (#17630)
* Add real whitespace to `no-trailing-spaces` examples * Fix space-only line
1 parent 1000187 commit 6b8acfb

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
 

‎docs/src/rules/no-trailing-spaces.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Examples of **incorrect** code for this rule:
1818
```js
1919
/*eslint no-trailing-spaces: "error"*/
2020

21-
var foo = 0;//•••••
22-
var baz = 5;//••
23-
//•••••
21+
var foo = 0;/* trailing whitespace */
22+
var baz = 5;/* trailing whitespace */
23+
/* trailing whitespace */
2424
```
2525

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

5959
var foo = 0;
6060
var baz = 5;
61-
//•••••
61+
// ↓ a line with whitespace only ↓
62+
6263
```
6364

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

75-
//foo•
76-
//•••••
76+
// ↓ these comments have trailing whitespace →
77+
//
7778
/**
78-
*baz
79-
*••
80-
*bar
79+
* baz
80+
*
81+
* bar
8182
*/
8283
```
8384

0 commit comments

Comments
 (0)
Please sign in to comment.