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 1 commit
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
8 changes: 7 additions & 1 deletion docs/rules/spaced-comment.md
Expand Up @@ -22,7 +22,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.
anikethsaha marked this conversation as resolved.
Show resolved Hide resolved
Please note that exceptions are ignored if the first argument is `"never"`.
Please note that exceptions are ignored if the first argument is `"never"`. It starts from the beginning of the line and checks untill the end of line or `*/` if its in same line
anikethsaha marked this conversation as resolved.
Show resolved Hide resolved

```
"spaced-comment": ["error", "always", { "exceptions": ["-", "+"] }]
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", { "line": { "exceptions": ["*"] } }] */
anikethsaha marked this conversation as resolved.
Show resolved Hide resolved

/******** 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