File tree 2 files changed +35
-2
lines changed
2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,23 @@ export function foo() {
9
9
return obj [ 'bar' ] ;
10
10
}
11
11
12
+ /**
13
+ * @typedef {Object } FoodOptions
14
+ * @property {number } calories The number of calories.
15
+ */
16
+
17
+ export class Food {
18
+ constructor ( options ) {
19
+ /**
20
+ * @type {number }
21
+ */
22
+ this . calories = options . calories ;
23
+ }
24
+ }
25
+
12
26
/**
13
27
* @typedef {Object } SoupOptions
28
+ * @property {number } calories The number of calories.
14
29
* @property {string } [type='chicken'] The type of soup.
15
30
* @property {boolean } [noodles=false] Include noodles.
16
31
* @property {Array<string> } [vegetables=[]] The vegetables.
@@ -22,12 +37,14 @@ export function foo() {
22
37
*
23
38
* @api
24
39
*/
25
- export class Soup {
40
+ export class Soup extends Food {
26
41
/**
27
42
* Construct a soup.
28
43
* @param {SoupOptions } options The soup options.
29
44
*/
30
45
constructor ( options ) {
46
+ super ( { calories : options . calories } ) ;
47
+
31
48
/**
32
49
* @private
33
50
* @type {string }
@@ -71,3 +88,19 @@ export class Soup {
71
88
return this . vegetables_ ;
72
89
}
73
90
}
91
+
92
+ /**
93
+ * @template {Food} [F=Soup]
94
+ */
95
+ export class Restaurant {
96
+ /**
97
+ * @param {Array<F> } menu The menu items.
98
+ */
99
+ constructor ( menu ) {
100
+ /**
101
+ * @private
102
+ * @type {Array<F> }
103
+ */
104
+ this . menu_ = [ ] ;
105
+ }
106
+ }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ module.exports = {
35
35
'jsdoc/empty-tags' : 'error' ,
36
36
'jsdoc/implements-on-classes' : 'error' ,
37
37
'jsdoc/no-bad-blocks' : 'error' ,
38
- 'jsdoc/no-undefined-types' : [ 'error' , { 'definedTypes' : [ 'ol' ] } ] ,
38
+ // 'jsdoc/no-undefined-types': ['error', {'definedTypes': ['ol']}], // blocked by https://github.com/gajus/eslint-plugin-jsdoc/issues/887
39
39
'jsdoc/require-hyphen-before-param-description' : [ 'error' , 'never' ] ,
40
40
'jsdoc/require-param' : 'error' ,
41
41
'jsdoc/require-param-description' : 'error' ,
You can’t perform that action at this time.
0 commit comments