{"id":19566321,"url":"https://github.com/juliendargelos/jsdoc-inheritparams-plugin","last_synced_at":"2025-10-13T17:02:24.155Z","repository":{"id":57284260,"uuid":"168214330","full_name":"juliendargelos/jsdoc-inheritparams-plugin","owner":"juliendargelos","description":"Inherit parameters documentation from any class or function with JSDoc.","archived":false,"fork":false,"pushed_at":"2019-05-24T09:49:57.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T05:27:57.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliendargelos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-29T19:25:55.000Z","updated_at":"2019-05-24T09:49:58.000Z","dependencies_parsed_at":"2022-09-16T22:41:31.003Z","dependency_job_id":null,"html_url":"https://github.com/juliendargelos/jsdoc-inheritparams-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Fjsdoc-inheritparams-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Fjsdoc-inheritparams-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Fjsdoc-inheritparams-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Fjsdoc-inheritparams-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliendargelos","download_url":"https://codeload.github.com/juliendargelos/jsdoc-inheritparams-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240831011,"owners_count":19864709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T05:31:04.917Z","updated_at":"2025-10-13T17:02:24.039Z","avatar_url":"https://github.com/juliendargelos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSDoc inherit params plugin\n\nInherit parameters documentation from any class or function with JSDoc.\n\n## Install\n\nWith yarn:\n\n```bash\nyarn add jsdoc-inheritparams-plugin --dev\n```\n\nWith npm:\n\n```bash\nnpm install jsdoc-inheritparams-plugin --save-dev\n```\n\nAdd the plugin to your JSDoc config:\n\n```json\n{\n  \"plugins\": [\n    \"node_modules/jsdoc-inheritparams-plugin\"\n  ]\n}\n```\n\n## Usage\n\n\u003e All these examples work with any kind of function (constructor, member's function, global function).\n\nConsider the following `User` class:\n\n```javascript\n/**\n * Represents a user.\n * @class User\n * @param {string} firstname User's firstname.\n * @param {string} lastname User's lastname.\n */\nclass User {\n  constructor(firstname, lastname) {\n    this.firstname = firstname\n    this.lastname = lastname\n  }\n}\n```\n\n#### Inherit parameters\n\n\u003e `@inheritparams` automatically determines super class from `@extends`.\n\n```javascript\n/**\n * Represents an admin user.\n * @class AdminUser\n * @extends User\n * @inheritparams\n */\nclass AdminUser extends User {\n  constructor(...args) {\n    super(...args)\n    this.admin = true\n  }\n}\n```\n\n#### Specify super class or function\n\n\u003e You can give an explicit super class of function to inherit parameters from.\\\n\u003e The given class or function can be any valid JSDoc path.\n\n```javascript\n/**\n * Represents an admin user.\n * @class AdminUser\n * @extends User\n * @inheritparams User\n */\nclass AdminUser extends User {\n  constructor(...args) {\n    super(...args)\n    this.admin = true\n  }\n}\n```\n\n#### Add extra parameters:\n\n```javascript\n/**\n * Represents an admin user.\n * @class AdminUser\n * @extends User\n * @inheritparams\n * @param {string} username Admin username.\n * @param {string} email Admin email.\n * @param {string} password Admin password.\n */\nclass AdminUser extends User {\n  constructor(firstname, lastname, username, email, password) {\n    super(firstname, lastname)\n    this.admin = true\n    this.username = username\n    this.email = email\n    this.password = password\n  }\n}\n```\n\n#### Specify inherited parameters offset\n\n\u003e Prefix the offset with a colon: `@inheritparams :4`.\\\n\u003e Super class or function path can be specified before offset: `@inheritparams CustomClass:4`.\\\n\u003e The default offset is `0` so inherited parameters are inserted before extra parameters (see previous example).\\\n\u003e The offset can be negative so it start from the end of extra parameters.\n\n```javascript\n/**\n * Represents an admin user.\n * @class AdminUser\n * @extends User\n * @inheritparams :1\n * @param {string} username Admin username.\n * @param {string} email Admin email.\n * @param {string} password Admin password.\n */\nclass AdminUser extends User {\n  constructor(\n    username,\n    firstname, lastname, // Offset 1\n    email,\n    password\n  ) {\n    // ...\n  }\n}\n```\n\n```javascript\n/**\n * Represents an admin user.\n * @class AdminUser\n * @extends User\n * @inheritparams :2\n * @param {string} username Admin username.\n * @param {string} email Admin email.\n * @param {string} password Admin password.\n */\nclass AdminUser extends User {\n  constructor(\n    username,\n    email,\n    firstname, lastname, // Offset 2\n    password\n  ) {\n    // ...\n  }\n}\n```\n\n```javascript\n/**\n * Represents an admin user.\n * @class AdminUser\n * @extends User\n * @inheritparams :3\n * @param {string} username Admin username.\n * @param {string} email Admin email.\n * @param {string} password Admin password.\n */\nclass AdminUser extends User {\n  constructor(\n    username,\n    email,\n    password,\n    firstname, lastname, // Offset 3\n  ) {\n    // ...\n  }\n}\n```\n\n```javascript\n/**\n * Represents an admin user.\n * @class AdminUser\n * @extends User\n * @inheritparams :-1\n * @param {string} username Admin username.\n * @param {string} email Admin email.\n * @param {string} password Admin password.\n */\nclass AdminUser extends User {\n  constructor(\n    username,\n    email,\n    password,\n    firstname, lastname, // Offset -1\n  ) {\n    // ...\n  }\n}\n```\n\n```javascript\n/**\n * Represents an admin user.\n * @class AdminUser\n * @extends User\n * @inheritparams :-2\n * @param {string} username Admin username.\n * @param {string} email Admin email.\n * @param {string} password Admin password.\n */\nclass AdminUser extends User {\n  constructor(\n    username,\n    email,\n    firstname, lastname, // Offset -2\n    password\n  ) {\n    // ...\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendargelos%2Fjsdoc-inheritparams-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliendargelos%2Fjsdoc-inheritparams-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendargelos%2Fjsdoc-inheritparams-plugin/lists"}