From 6b8acfb770589f3941df41c3910d3b8ffc3e1e45 Mon Sep 17 00:00:00 2001 From: Francesco Trotta Date: Mon, 9 Oct 2023 09:15:58 +0200 Subject: [PATCH] docs: Add real whitespace to `no-trailing-spaces` examples (#17630) * Add real whitespace to `no-trailing-spaces` examples * Fix space-only line --- docs/src/rules/no-trailing-spaces.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/src/rules/no-trailing-spaces.md b/docs/src/rules/no-trailing-spaces.md index fba4f7df9a2..61aec1fcf4a 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,8 @@ Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` var foo = 0; var baz = 5; -//••••• +// ↓ a line with whitespace only ↓ + ``` ::: @@ -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 */ ```