Skip to content

Commit 9c586c5

Browse files
committed
docs: generate docs
1 parent 0b04319 commit 9c586c5

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<a name="eslint-plugin-jsdoc"></a>
22
# eslint-plugin-jsdoc
33

4-
[![GitSpo Mentions](https://gitspo.com/badges/gajus/eslint-plugin-jsdoc?style=flat-square)](https://gitspo.com/mentions/gajus/eslint-plugin-jsdoc)
4+
[![GitSpo Mentions](https://gitspo.com/badges/mentions/gajus/eslint-plugin-jsdoc?style=flat-square)](https://gitspo.com/mentions/gajus/eslint-plugin-jsdoc)
55
[![NPM version](http://img.shields.io/npm/v/eslint-plugin-jsdoc.svg?style=flat-square)](https://www.npmjs.org/package/eslint-plugin-jsdoc)
66
[![Travis build status](http://img.shields.io/travis/gajus/eslint-plugin-jsdoc/master.svg?style=flat-square)](https://travis-ci.org/gajus/eslint-plugin-jsdoc)
77
[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
@@ -1109,6 +1109,8 @@ Reports invalid types.
11091109
Ensures that case of native types is the same as in this list:
11101110

11111111
```
1112+
undefined
1113+
null
11121114
boolean
11131115
number
11141116
string
@@ -1121,9 +1123,9 @@ RegExp
11211123
<a name="eslint-plugin-jsdoc-rules-check-types-why-not-capital-case-everything"></a>
11221124
#### Why not capital case everything?
11231125

1124-
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()`.
1126+
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()`.
11251127

1126-
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.
1128+
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.
11271129

11281130
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.
11291131

@@ -1428,6 +1430,21 @@ function quux(foo) {
14281430
function quux(foo) {
14291431

14301432
}
1433+
1434+
/**
1435+
* Callback test.
1436+
*
1437+
* @callback addStuffCallback
1438+
* @param {String} sum - An test integer.
1439+
*/
1440+
/**
1441+
* Test Eslint.
1442+
*
1443+
* @param {addStuffCallback} callback - A callback to run.
1444+
*/
1445+
function testFunction(callback) {
1446+
callback();
1447+
}
14311448
````
14321449

14331450

@@ -2696,6 +2713,18 @@ function quux (foo) {
26962713

26972714
Requires all types to be valid JSDoc or Closure compiler types without syntax errors.
26982715

2716+
Also impacts behaviors on namepath-pointing or event-pointing tags:
2717+
2718+
1. `@alias`, `@augments`, `@extends`, `@lends`, `@memberof`, `@memberof!`, `@mixes`, `@name`, `@this`
2719+
1. `@callback`, `@event`, `@listens`, `@fires`, `@emits`
2720+
1. `@borrows`
2721+
2722+
The following apply to the above sets:
2723+
2724+
- Expect tags in set 1 or 2 to have a valid namepath if present
2725+
- Prevent set 2 from being empty by setting `allowEmptyNamepaths` to `false` as these tags might have some indicative value without a path (but set 1 will always fail if empty)
2726+
- For the special case of set 3, i.e., `@borrows <that namepath> as <this namepath>`, check that both namepaths are present and valid and ensure there is an `as ` between them.
2727+
26992728
|||
27002729
|---|---|
27012730
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|

0 commit comments

Comments
 (0)