From 51360c8e9d1e35987b0e3526171cb21648c4b8ca Mon Sep 17 00:00:00 2001 From: Victor Hom Date: Wed, 11 Oct 2017 03:47:06 -0400 Subject: [PATCH] Docs: update block-spacing details (fixes #8743) (#9375) --- docs/rules/block-spacing.md | 7 +++++-- lib/rules/block-spacing.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/rules/block-spacing.md b/docs/rules/block-spacing.md index 2e37fe54b7d..aef7c333cd3 100644 --- a/docs/rules/block-spacing.md +++ b/docs/rules/block-spacing.md @@ -1,8 +1,8 @@ -# Disallow or enforce spaces inside of single line blocks (block-spacing) +# Disallow or enforce spaces inside of blocks after opening block and before closing block (block-spacing) ## Rule Details -This rule enforces consistent spacing inside single-line blocks. +This rule enforces consistent spacing inside an open block token and the next token on the same line. This rule also enforces consistent spacing inside a close block token and previous token on the same line. ## Options @@ -20,6 +20,9 @@ Examples of **incorrect** code for this rule with the default `"always"` option: function foo() {return true;} if (foo) { bar = 0;} +function baz() {let i = 0; + return i; +} ``` Examples of **correct** code for this rule with the default `"always"` option: diff --git a/lib/rules/block-spacing.js b/lib/rules/block-spacing.js index f18381a3103..b3ea8405e24 100644 --- a/lib/rules/block-spacing.js +++ b/lib/rules/block-spacing.js @@ -14,7 +14,7 @@ const util = require("../ast-utils"); module.exports = { meta: { docs: { - description: "enforce consistent spacing inside single-line blocks", + description: "disallow or enforce spaces inside of blocks after opening block and before closing block", category: "Stylistic Issues", recommended: false },