Skip to content

docs(background.js): add param and returns to readLocationHeader JSDoc#178

Merged
ormidales merged 1 commit into1.0.10from
copilot/patch-add-jsdoc-annotations
Mar 16, 2026
Merged

docs(background.js): add param and returns to readLocationHeader JSDoc#178
ormidales merged 1 commit into1.0.10from
copilot/patch-add-jsdoc-annotations

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

readLocationHeader had a prose-only JSDoc block, leaving IDE tooling without type hints and the function contract implicit.

Changes

  • background.js: Added @param and @returns annotations to readLocationHeader, following the existing background.js convention (no dash between parameter name and description):
/**
 * Extracts the value of the HTTP `Location` response header from a header array.
 * Comparison is case-insensitive to match RFC 7230 requirements.
 *
 * @param {browser.webRequest.HttpHeader[]} [headers=[]] Array of response headers.
 * @returns {string} The Location header value, or "" if absent or malformed.
 */
const readLocationHeader = (headers = []) => {  };
Original prompt

This section details on the original issue you should resolve

<issue_title>[PATCH] readLocationHeader() JSDoc is missing @param and @returns annotations</issue_title>
<issue_description>Category: documentation
Severity: patch
File(s): background.js

Description

readLocationHeader(headers) correctly extracts the HTTP Location response header, but its JSDoc block only contains a prose description. The @param and @returns tags are absent, which prevents IDE tooling from providing type hints and makes the contract less explicit for contributors.

Problematic code example

/**
 * Extracts the value of the HTTP `Location` response header from a header array.
 * Comparison is case-insensitive to match RFC 7230 requirements.
 */
const readLocationHeader = (headers = []) => {  };

Suggested fix

/**
 * Extracts the value of the HTTP `Location` response header from a header array.
 * Comparison is case-insensitive to match RFC 7230 requirements.
 *
 * @param {browser.webRequest.HttpHeader[]} [headers=[]] - Array of response headers.
 * @returns {string} The Location header value, or `""` if absent or malformed.
 */
const readLocationHeader = (headers = []) => {  };

Acceptance criteria

  • @param tag is present with type and description
  • @returns tag is present with type and description
  • Documentation is consistent with other functions in the file</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] [PATCH] Add @param and @returns annotations to readLocationHeader() JSDoc docs(background.js): add @param and @returns to readLocationHeader JSDoc Mar 16, 2026
Copilot AI requested a review from ormidales March 16, 2026 08:39
@ormidales ormidales added this to the v1.0.10 milestone Mar 16, 2026
@ormidales ormidales linked an issue Mar 16, 2026 that may be closed by this pull request
3 tasks
@ormidales ormidales changed the title docs(background.js): add @param and @returns to readLocationHeader JSDoc docs(background.js): add param and @returns to readLocationHeader JSDoc Mar 16, 2026
@ormidales ormidales changed the title docs(background.js): add param and @returns to readLocationHeader JSDoc docs(background.js): add param and returns to readLocationHeader JSDoc Mar 16, 2026
@ormidales ormidales marked this pull request as ready for review March 16, 2026 08:41
Copilot AI review requested due to automatic review settings March 16, 2026 08:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ormidales ormidales merged commit 51d4e84 into 1.0.10 Mar 16, 2026
1 check passed
@ormidales ormidales deleted the copilot/patch-add-jsdoc-annotations branch March 16, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PATCH] readLocationHeader() JSDoc is missing param and returns annotations

3 participants