Skip to content

Commit 055861c

Browse files
committed
Rendered docs.
1 parent 5660f0c commit 055861c

File tree

1 file changed

+90
-11
lines changed

1 file changed

+90
-11
lines changed

README.md

Lines changed: 90 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ JSDoc linting rules for ESLint.
1818
* [`check-types`](#eslint-plugin-jsdoc-rules-check-types)
1919
* [`newline-after-description`](#eslint-plugin-jsdoc-rules-newline-after-description)
2020
* [`require-description-complete-sentence`](#eslint-plugin-jsdoc-rules-require-description-complete-sentence)
21-
* [`require-param-description`](#eslint-plugin-jsdoc-rules-require-param-description)
21+
* [`require-description-complete-sentence`](#eslint-plugin-jsdoc-rules-require-description-complete-sentence)
2222
* [`require-param`](#eslint-plugin-jsdoc-rules-require-param)
2323
* [`require-param-description`](#eslint-plugin-jsdoc-rules-require-param-description)
2424
* [`require-param-type`](#eslint-plugin-jsdoc-rules-require-param-type)
@@ -37,7 +37,7 @@ This table maps the rules between `eslint-plugin-jsdoc` and `jscs-jsdoc`.
3737
| [`check-types`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-types) | [`checkTypes`](https://github.com/jscs-dev/jscs-jsdoc#checktypes) |
3838
| [`newline-after-description`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-newline-after-description) | [`requireNewlineAfterDescription`](https://github.com/jscs-dev/jscs-jsdoc#requirenewlineafterdescription) and [`disallowNewlineAfterDescription`](https://github.com/jscs-dev/jscs-jsdoc#disallownewlineafterdescription) |
3939
| [`require-description-complete-sentence`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-description-complete-sentence) | [`requireDescriptionCompleteSentence`](https://github.com/jscs-dev/jscs-jsdoc#requiredescriptioncompletesentence) |
40-
| [`require-hyphen-before-description`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-hyphen-before-description) | [`requireHyphenBeforeDescription`](https://github.com/jscs-dev/jscs-jsdoc#requirehyphenbeforedescription) |
40+
| [`require-hyphen-before-param-description`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-hyphen-before-param-description) | [`requireHyphenBeforeDescription`](https://github.com/jscs-dev/jscs-jsdoc#requirehyphenbeforedescription) |
4141
| [`require-param`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param) | [`checkParamExistence`](https://github.com/jscs-dev/jscs-jsdoc#checkparamexistence) |
4242
| [`require-param-description`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-description) | [`requireParamDescription`](https://github.com/jscs-dev/jscs-jsdoc#requireparamdescription) |
4343
| [`require-param-type`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-type) | [`requireParamTypes`](https://github.com/jscs-dev/jscs-jsdoc#requireparamtypes) |
@@ -86,7 +86,7 @@ Finally, enable all of the rules that you would like to use.
8686
"jsdoc/check-types": 1,
8787
"jsdoc/newline-after-description": 1,
8888
"jsdoc/require-description-complete-sentence": 1,
89-
"jsdoc/require-hyphen-before-description": 1,
89+
"jsdoc/require-hyphen-before-param-description": 1,
9090
"jsdoc/require-param": 1,
9191
"jsdoc/require-param-description": 1,
9292
"jsdoc/require-param-type": 1,
@@ -226,6 +226,13 @@ function quux (foo, bar) {
226226

227227
}
228228

229+
/**
230+
* @param args
231+
*/
232+
function quux (...args) {
233+
234+
}
235+
229236
/**
230237
* @param foo
231238
*/
@@ -632,27 +639,67 @@ function quux () {
632639
```
633640

634641

635-
<h3 id="eslint-plugin-jsdoc-rules-require-param-description"><code>require-param-description</code></h3>
642+
<h3 id="eslint-plugin-jsdoc-rules-require-description-complete-sentence"><code>require-description-complete-sentence</code></h3>
636643

637-
Requires that `@param` tag has `description` value.
644+
Requires that block description and tag description are written in complete sentences, i.e.,
645+
646+
* Description must start with an uppercase alphabetical character.
647+
* Paragraph must start with an uppercase alphabetical character.
648+
* Sentences must end with a period.
649+
* Every line that starts with a lowercase character must be preceded by a line ending the sentence.
638650

639651
|||
640652
|---|---|
641653
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
642-
|Tags|`param`|
654+
|Tags|`param`, `returns`|
643655

644656
The following patterns are considered problems:
645657

646658
```js
647659
/**
648-
* @param foo
660+
* foo.
661+
*/
662+
function quux () {
663+
664+
}
665+
666+
/**
667+
* Foo.
668+
*
669+
* foo.
670+
*/
671+
function quux () {
672+
673+
}
674+
675+
/**
676+
* Foo
677+
*/
678+
function quux () {
679+
680+
}
681+
682+
/**
683+
* Foo
684+
* Bar.
685+
*/
686+
function quux () {
687+
688+
}
689+
690+
/**
691+
* Foo.
692+
*
693+
* @param foo foo.
649694
*/
650695
function quux (foo) {
651696

652697
}
653698

654699
/**
655-
* @arg foo
700+
* Foo.
701+
*
702+
* @returns foo.
656703
*/
657704
function quux (foo) {
658705

@@ -663,16 +710,48 @@ The following patterns are not considered problems:
663710

664711
```js
665712
/**
713+
* @param foo - Foo.
714+
*/
715+
function quux () {
716+
717+
}
718+
719+
/**
720+
* Foo.
721+
*/
722+
function quux () {
723+
724+
}
725+
726+
/**
727+
* Foo.
728+
* Bar.
729+
*/
730+
function quux () {
731+
732+
}
733+
734+
/**
735+
* Foo.
666736
*
737+
* Bar.
667738
*/
668-
function quux (foo) {
739+
function quux () {
669740

670741
}
671742

672743
/**
673-
* @param foo Foo.
744+
* Foo
745+
* bar.
674746
*/
675-
function quux (foo) {
747+
function quux () {
748+
749+
}
750+
751+
/**
752+
* @returns Foo bar.
753+
*/
754+
function quux () {
676755

677756
}
678757
```

0 commit comments

Comments
 (0)