You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`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)|
@@ -71,8 +74,11 @@ Finally, enable all of the rules that you would like to use.
71
74
```json
72
75
{
73
76
"rules": {
77
+
"jsdoc/check-alignment": 1,
74
78
"jsdoc/check-examples": 1,
79
+
"jsdoc/check-indentation": 1,
75
80
"jsdoc/check-param-names": 1,
81
+
"jsdoc/check-syntax": 1,
76
82
"jsdoc/check-tag-names": 1,
77
83
"jsdoc/check-types": 1,
78
84
"jsdoc/newline-after-description": 1,
@@ -245,8 +251,11 @@ Finally, the following rule pertains to inline disable directives:
|[`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)|
@@ -104,8 +110,11 @@ Finally, enable all of the rules that you would like to use.
104
110
```json
105
111
{
106
112
"rules": {
113
+
"jsdoc/check-alignment": 1,
107
114
"jsdoc/check-examples": 1,
115
+
"jsdoc/check-indentation": 1,
108
116
"jsdoc/check-param-names": 1,
117
+
"jsdoc/check-syntax": 1,
109
118
"jsdoc/check-tag-names": 1,
110
119
"jsdoc/check-types": 1,
111
120
"jsdoc/newline-after-description": 1,
@@ -285,6 +294,87 @@ Finally, the following rule pertains to inline disable directives:
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()`.
935
1108
936
-
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.
937
1110
938
1111
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.
939
1112
@@ -1035,6 +1208,30 @@ function quux (foo, bar, baz) {
1035
1208
*/
1036
1209
functionquux (foo, bar, baz) {
1037
1210
1211
+
}
1212
+
1213
+
/**
1214
+
* @param{typeof bar}foo
1215
+
*/
1216
+
functionqux(foo) {
1217
+
}
1218
+
1219
+
/**
1220
+
* @param{import('./foo').bar.baz}foo
1221
+
*/
1222
+
functionqux(foo) {
1223
+
}
1224
+
1225
+
/**
1226
+
* @param{(x: number, y: string) => string}foo
1227
+
*/
1228
+
functionqux(foo) {
1229
+
}
1230
+
1231
+
/**
1232
+
* @param{() => string}foo
1233
+
*/
1234
+
functionqux(foo) {
1038
1235
}
1039
1236
````
1040
1237
@@ -2284,6 +2481,16 @@ function quux (foo) {
2284
2481
*/
2285
2482
constquux= () => {}
2286
2483
// Message: Present JSDoc @returns declaration but not available return expression in function.
2484
+
2485
+
/**
2486
+
* @returns{undefined} Foo.
2487
+
* @returns{String} Foo.
2488
+
*/
2489
+
functionquux () {
2490
+
2491
+
return foo;
2492
+
}
2493
+
// Message: Found more than one @returns declaration.
2287
2494
````
2288
2495
2289
2496
The following patterns are not considered problems:
@@ -2324,15 +2531,23 @@ function quux () {
2324
2531
*/
2325
2532
constquux= () => foo;
2326
2533
2327
-
/**
2534
+
/**
2328
2535
* @returns{Promise<void>}
2329
2536
*/
2330
2537
asyncfunctionquux() {}
2331
2538
2332
-
/**
2539
+
/**
2333
2540
* @returns{Promise<void>}
2334
2541
*/
2335
2542
async () => {}
2543
+
2544
+
/**
2545
+
* @returns Foo.
2546
+
* @abstract
2547
+
*/
2548
+
functionquux () {
2549
+
thrownewError('must be implemented by subclass!');
0 commit comments