Skip to content

fix: apply Prettier formatting to assign_agent_helpers.cjs#19501

Merged
pelikhan merged 2 commits intojsweep/clean-assign-agent-helpers-653b7c6142a9f284from
copilot/sub-pr-19495
Mar 4, 2026
Merged

fix: apply Prettier formatting to assign_agent_helpers.cjs#19501
pelikhan merged 2 commits intojsweep/clean-assign-agent-helpers-653b7c6142a9f284from
copilot/sub-pr-19495

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

assign_agent_helpers.cjs had a minor code style issue that caused npm run lint:cjs (Prettier check) to fail.

  • assign_agent_helpers.cjs: ran prettier --write to fix formatting

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

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Clean assign_agent_helpers.cjs file fix: apply Prettier formatting to assign_agent_helpers.cjs Mar 4, 2026
@pelikhan pelikhan marked this pull request as ready for review March 4, 2026 04:29
Copilot AI review requested due to automatic review settings March 4, 2026 04:29
@pelikhan pelikhan merged commit dd4298b into jsweep/clean-assign-agent-helpers-653b7c6142a9f284 Mar 4, 2026
@pelikhan pelikhan deleted the copilot/sub-pr-19495 branch March 4, 2026 04:29
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.

Pull request overview

This PR applies Prettier formatting to assign_agent_helpers.cjs to fix a failing npm run lint:cjs check. The sole change is the removal of parentheses around the value expression in a JSDoc type cast on line 250.

Changes:

  • Removes parentheses from /** @type {any} */ (error)/** @type {any} */ error at line 250 to satisfy Prettier's formatting rules.

💡 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.

try {
if (!error || typeof error !== "object") return;
const err = /** @type {any} */ (error);
const err = /** @type {any} */ error;
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

Removing the parentheses from a JSDoc type cast breaks the cast entirely. In JSDoc, the correct syntax for a type cast/assertion is /** @type {T} */ (expr) — the parentheses are required for the cast to take effect. Without them, /** @type {any} */ error is just an inline comment and err retains its original type (unknown). As a result, accessing err.errors, err.response, and err.data further down will be flagged as errors by type checkers (TypeScript/Flow) in strict mode, since those properties don't exist on unknown.

Notice that line 422 uses the same pattern and has a // prettier-ignore comment specifically to prevent Prettier from removing these parentheses. The correct fix for line 250 is to add // prettier-ignore on the line before it, preserving the parenthesized cast, rather than letting Prettier strip the parentheses and silently break the type cast.

See below for a potential fix:

    // prettier-ignore
    const err = /** @type {any} */ (error);
    const details = {
      ...(err.errors && { errors: err.errors }),
      ...(err.response && { response: err.response }),
      ...(err.data && { data: err.data }),

Copilot uses AI. Check for mistakes.
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.

3 participants