-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1ea352
commit 8e13fa7
Showing
7 changed files
with
1,569 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
### `informative-docs` | ||
|
||
Reports on JSDoc texts that serve only to restart their attached name. | ||
|
||
Devs sometimes write JSDoc descriptions that add no additional information just to fill out the doc: | ||
|
||
```js | ||
/** The user id. */ | ||
let userId; | ||
``` | ||
|
||
Those "uninformative" docs comments take up space without being helpful. | ||
This rule requires all docs comments contain at least one word not already in the code. | ||
|
||
#### Options | ||
|
||
#### `aliases` | ||
|
||
The `aliases` option allows indicating words as synonyms (aliases) of each other. | ||
|
||
For example, with `{ aliases: { emoji: ["smiley", "winkey"] } }`, the following comment would be considered uninformative: | ||
|
||
```js | ||
/** A smiley/winkey. */ | ||
let emoji; | ||
``` | ||
|
||
The default `aliases` option is: | ||
|
||
```json | ||
{ | ||
"a": ["an", "our"] | ||
} | ||
``` | ||
|
||
#### `uselessWords` | ||
|
||
Words that are ignored when searching for one that adds meaning. | ||
|
||
For example, with `{ uselessWords: ["our"] }`, the following comment would be considered uninformative: | ||
|
||
```js | ||
/** Our text. */ | ||
let text; | ||
``` | ||
|
||
The default `uselessWords` option is: | ||
|
||
```json | ||
["a", "an", "i", "in", "of", "s", "the"] | ||
``` | ||
|
||
||| | ||
|---|---| | ||
|Context|everywhere| | ||
|Tags|any| | ||
|Recommended|false| | ||
|Settings|| | ||
|Options|`aliases`, `uselessWords`| | ||
|
||
<!-- assertions informativeDocs --> |
Oops, something went wrong.