Skip to content

Commit a81160e

Browse files
committed
docs: generate docs
1 parent 14f7480 commit a81160e

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ function quux (foo) {
10161016
}
10171017
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["baz","bar"]}}}
10181018

1019-
/**
1019+
/**
10201020
* @abstract
10211021
* @access
10221022
* @alias
@@ -1104,9 +1104,9 @@ RegExp
11041104
<a name="eslint-plugin-jsdoc-rules-check-types-why-not-capital-case-everything"></a>
11051105
#### Why not capital case everything?
11061106

1107-
Why are `boolean`, `number` and `string` exempt from starting with a capital letter? Let's take `string` as an example. In Javascript, everything is an object. The string Object has prototypes for string functions such as `.toUpperCase()`.
1107+
Why are `boolean`, `number` and `string` exempt from starting with a capital letter? Let's take `string` as an example. In Javascript, everything is an object. The string Object has prototypes for string functions such as `.toUpperCase()`.
11081108

1109-
Fortunately we don't have to write `new String()` everywhere in our code. Javascript will automatically wrap string primitives into string Objects when we're applying a string function to a string primitive. This way the memory footprint is a tiny little bit smaller, and the [GC](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) has less work to do.
1109+
Fortunately we don't have to write `new String()` everywhere in our code. Javascript will automatically wrap string primitives into string Objects when we're applying a string function to a string primitive. This way the memory footprint is a tiny little bit smaller, and the [GC](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) has less work to do.
11101110

11111111
So in a sense, there two types of strings in Javascript; `{string}` literals, also called primitives and `{String}` Objects. We use the primitives because it's easier to write and uses less memory. `{String}` and `{string}` are technically both valid, but they are not the same.
11121112

@@ -2464,7 +2464,6 @@ The following patterns are considered problems:
24642464
*/
24652465
function quux (foo) {
24662466

2467-
return foo;
24682467
}
24692468
// Message: Present JSDoc @returns declaration but not available return expression in function.
24702469

@@ -2473,7 +2472,6 @@ function quux (foo) {
24732472
*/
24742473
function quux (foo) {
24752474

2476-
return foo;
24772475
}
24782476
// Settings: {"jsdoc":{"tagNamePreference":{"returns":"return"}}}
24792477
// Message: Present JSDoc @return declaration but not available return expression in function.
@@ -2483,6 +2481,16 @@ function quux (foo) {
24832481
*/
24842482
const quux = () => {}
24852483
// Message: Present JSDoc @returns declaration but not available return expression in function.
2484+
2485+
/**
2486+
* @returns {undefined} Foo.
2487+
* @returns {String} Foo.
2488+
*/
2489+
function quux () {
2490+
2491+
return foo;
2492+
}
2493+
// Message: Found more than one @returns declaration.
24862494
````
24872495

24882496
The following patterns are not considered problems:
@@ -2523,15 +2531,23 @@ function quux () {
25232531
*/
25242532
const quux = () => foo;
25252533

2526-
/**
2534+
/**
25272535
* @returns {Promise<void>}
25282536
*/
25292537
async function quux() {}
25302538

2531-
/**
2539+
/**
25322540
* @returns {Promise<void>}
25332541
*/
25342542
async () => {}
2543+
2544+
/**
2545+
* @returns Foo.
2546+
* @abstract
2547+
*/
2548+
function quux () {
2549+
throw new Error('must be implemented by subclass!');
2550+
}
25352551
````
25362552

25372553

0 commit comments

Comments
 (0)