[Docs] add reference to spaced-comment rule; flesh out options

This commit is contained in:
Jordan Harband
2016-10-31 21:36:28 -07:00
parent 9cbda0f0e7
commit 017dfa81fa
2 changed files with 12 additions and 3 deletions

View File

@@ -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

View File

@@ -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