Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: clarify exceptions in spaced-comment (fixes #13032) #13126

Merged
merged 4 commits into from Apr 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 17 additions & 1 deletion docs/rules/spaced-comment.md
Expand Up @@ -21,7 +21,7 @@ The rule takes two options.

* This rule can also take a 2nd option, an object with any of the following keys: `"exceptions"` and `"markers"`.

* The `"exceptions"` value is an array of string patterns which are considered exceptions to the rule.
* The `"exceptions"` value is an array of string patterns which are considered exceptions to the rule. The rule will not warn when the pattern starts from the beginning of the comment and repeats until the end of the line or `*/` if the comment is a single line comment.
Please note that exceptions are ignored if the first argument is `"never"`.

```
Expand Down Expand Up @@ -175,6 +175,12 @@ Examples of **incorrect** code for this rule with the `"always"` option combined
/*-+-+-+-+-+-+-+*/
```

```js
/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["*"] } }] */

/******** COMMENT *******/
anikethsaha marked this conversation as resolved.
Show resolved Hide resolved
```

Examples of **correct** code for this rule with the `"always"` option combined with `"exceptions"`:

```js
Expand Down Expand Up @@ -221,6 +227,16 @@ Examples of **correct** code for this rule with the `"always"` option combined w
/*-+-+-+-+-+-+-+*/
```

```js
/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["*"] } }] */

/***************/

/********
COMMENT
*******/
```

### markers

Examples of **incorrect** code for this rule with the `"always"` option combined with `"markers"`:
Expand Down