From 017dfa81fa2ffbb191ddb28240aa6098837b8d1b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 31 Oct 2016 21:36:28 -0700 Subject: [PATCH] [Docs] add reference to spaced-comment rule; flesh out options --- README.md | 2 +- packages/eslint-config-airbnb-base/rules/style.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f3fad84..29ba8810 100644 --- a/README.md +++ b/README.md @@ -1922,7 +1922,7 @@ Other Style Guides } ``` - - [17.3](#comments--spaces) Start all comments with a space to make it easier to read. + - [17.3](#comments--spaces) Start all comments with a space to make it easier to read. eslint: [`spaced-comment`](http://eslint.org/docs/rules/spaced-comment) ```javascript // bad diff --git a/packages/eslint-config-airbnb-base/rules/style.js b/packages/eslint-config-airbnb-base/rules/style.js index 7d86567a..c9e7c0f7 100644 --- a/packages/eslint-config-airbnb-base/rules/style.js +++ b/packages/eslint-config-airbnb-base/rules/style.js @@ -351,9 +351,18 @@ module.exports = { }], // require or disallow a space immediately following the // or /* in a comment + // http://eslint.org/docs/rules/spaced-comment + // TODO: semver-major: set balanced to "false" 'spaced-comment': ['error', 'always', { - exceptions: ['-', '+'], - markers: ['=', '!'] // space here to support sprockets directives + line: { + exceptions: ['-', '+'], + markers: ['=', '!'], // space here to support sprockets directives + }, + block: { + exceptions: ['-', '+'], + markers: ['=', '!'], // space here to support sprockets directives + balanced: false, + } }], // require or disallow the Unicode Byte Order Mark