From dd70e322edeff0addeef78e4415a07b657bc18b9 Mon Sep 17 00:00:00 2001 From: Francesco Trotta Date: Sun, 8 Oct 2023 00:40:12 +0200 Subject: [PATCH 1/2] Add real whitespace to `no-trailing-spaces` examples --- docs/src/rules/no-trailing-spaces.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/src/rules/no-trailing-spaces.md b/docs/src/rules/no-trailing-spaces.md index fba4f7df9a21..d39ca6138429 100644 --- a/docs/src/rules/no-trailing-spaces.md +++ b/docs/src/rules/no-trailing-spaces.md @@ -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 */ ``` ::: @@ -58,7 +58,7 @@ Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` var foo = 0; var baz = 5; -//••••• +// trailing whitespace → ``` ::: @@ -72,12 +72,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 */ ``` From 52cd91280bdb82b3bb4e9137ab312eeb362d3960 Mon Sep 17 00:00:00 2001 From: Francesco Trotta Date: Mon, 9 Oct 2023 08:19:12 +0200 Subject: [PATCH 2/2] Fix space-only line --- docs/src/rules/no-trailing-spaces.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/rules/no-trailing-spaces.md b/docs/src/rules/no-trailing-spaces.md index d39ca6138429..61aec1fcf4aa 100644 --- a/docs/src/rules/no-trailing-spaces.md +++ b/docs/src/rules/no-trailing-spaces.md @@ -58,7 +58,8 @@ Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` var foo = 0; var baz = 5; -// trailing whitespace → +// ↓ a line with whitespace only ↓ + ``` :::