File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,23 @@ export function foo() {
99 return obj [ 'bar' ] ;
1010}
1111
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+
1226/**
1327 * @typedef {Object } SoupOptions
28+ * @property {number } calories The number of calories.
1429 * @property {string } [type='chicken'] The type of soup.
1530 * @property {boolean } [noodles=false] Include noodles.
1631 * @property {Array<string> } [vegetables=[]] The vegetables.
@@ -22,12 +37,14 @@ export function foo() {
2237 *
2338 * @api
2439 */
25- export class Soup {
40+ export class Soup extends Food {
2641 /**
2742 * Construct a soup.
2843 * @param {SoupOptions } options The soup options.
2944 */
3045 constructor ( options ) {
46+ super ( { calories : options . calories } ) ;
47+
3148 /**
3249 * @private
3350 * @type {string }
@@ -71,3 +88,19 @@ export class Soup {
7188 return this . vegetables_ ;
7289 }
7390}
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 = {
3535 'jsdoc/empty-tags' : 'error' ,
3636 'jsdoc/implements-on-classes' : 'error' ,
3737 '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
3939 'jsdoc/require-hyphen-before-param-description' : [ 'error' , 'never' ] ,
4040 'jsdoc/require-param' : 'error' ,
4141 'jsdoc/require-param-description' : 'error' ,
You can’t perform that action at this time.
0 commit comments