Skip to content

Commit 017dfa8

Browse files
committed
[Docs] add reference to spaced-comment rule; flesh out options
1 parent 9cbda0f commit 017dfa8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ Other Style Guides
19221922
}
19231923
```
19241924
1925-
- [17.3](#comments--spaces) Start all comments with a space to make it easier to read.
1925+
- [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)
19261926
19271927
```javascript
19281928
// bad

packages/eslint-config-airbnb-base/rules/style.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,18 @@ module.exports = {
351351
}],
352352

353353
// require or disallow a space immediately following the // or /* in a comment
354+
// http://eslint.org/docs/rules/spaced-comment
355+
// TODO: semver-major: set balanced to "false"
354356
'spaced-comment': ['error', 'always', {
355-
exceptions: ['-', '+'],
356-
markers: ['=', '!'] // space here to support sprockets directives
357+
line: {
358+
exceptions: ['-', '+'],
359+
markers: ['=', '!'], // space here to support sprockets directives
360+
},
361+
block: {
362+
exceptions: ['-', '+'],
363+
markers: ['=', '!'], // space here to support sprockets directives
364+
balanced: false,
365+
}
357366
}],
358367

359368
// require or disallow the Unicode Byte Order Mark

0 commit comments

Comments
 (0)