Skip to content

chore: add jsdoc tags#233

Open
Fdawgs wants to merge 4 commits intomainfrom
chore/jsdoc-tags
Open

chore: add jsdoc tags#233
Fdawgs wants to merge 4 commits intomainfrom
chore/jsdoc-tags

Conversation

@Fdawgs
Copy link
Member

@Fdawgs Fdawgs commented Mar 8, 2026

Without the tags, VS Code's IntelliSense could not provide autocomplete, parameter hints, or type checking when working in the codebase, which made contributing harder than it needed to be.

This probably also helps other IDEs.

Checklist

Copilot AI review requested due to automatic review settings March 8, 2026 10:12
Copy link

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.

Pull request overview

This PR adds JSDoc/type annotations across the Fastify bearer-auth plugin code to improve editor IntelliSense (autocomplete, parameter hints, and type checking) when working in the JS codebase.

Changes:

  • Added JSDoc blocks and import('../types/index')-based type annotations for the main plugin and auth factory functions.
  • Documented helper/auth functions (compare, authenticate, handleUnauthorized) with JSDoc params/returns.
  • Refactored lib/compare.js to import timingSafeEqual via destructuring.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
lib/verify-bearer-auth-factory.js Adds JSDoc/type annotations for the factory and internal helper(s).
lib/compare.js Adds JSDoc for constant-time comparison and refactors crypto import.
lib/authenticate.js Adds JSDoc for key authentication helper.
index.js Adds a top-level JSDoc/type annotation for the exported plugin function.

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

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants