Skip to content

chore: remove 'any' types and update metadata#23

Merged
Zoltan Hricz (hriczzoli) merged 3 commits intomainfrom
tighten-up-the-project-with-typescript-strict-mode-dxa-2887
Mar 17, 2026
Merged

chore: remove 'any' types and update metadata#23
Zoltan Hricz (hriczzoli) merged 3 commits intomainfrom
tighten-up-the-project-with-typescript-strict-mode-dxa-2887

Conversation

@hriczzoli
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 16, 2026 14:00
@linear
Copy link
Copy Markdown

linear Bot commented Mar 16, 2026

Copy link
Copy Markdown
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 focuses on tightening TypeScript typing (removing any-based narrowing) across error formatting and postMessage handling, while also updating package metadata and adding targeted tests to lock in the new behavior.

Changes:

  • Add tests for formatError to validate object-based error formatting and status-code extraction.
  • Replace any usage with type guards / safer narrowing in errorFormatter and PostMessageHandler.
  • Update public API typing for setCredentials, and refactor iframe sandbox policy into a constant.

Reviewed changes

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

Show a summary per file
File Description
test/error-formatter.test.ts Adds coverage for formatError object/JSON-details behavior.
src/utils/errorFormatter.ts Introduces isRecord narrowing and refactors object error handling to avoid any.
src/utils/PostMessageHandler.ts Adds type guards for incoming postMessage data and types pending request handlers.
src/types/api.ts Switches setCredentials argument type to SetCredentialsPayload.
src/CortiEmbedded.ts Replaces as any sandbox binding with a reusable constant.
package.json Updates sideEffects metadata (now includes src/corti-embedded.ts).

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

Comment thread src/utils/errorFormatter.ts Outdated
Comment thread src/utils/errorFormatter.ts Outdated
Comment thread package.json Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks solid

Comment thread src/utils/errorFormatter.ts Outdated
Comment thread src/CortiEmbedded.ts Outdated
@hriczzoli Zoltan Hricz (hriczzoli) merged commit 5d6c5d3 into main Mar 17, 2026
4 checks passed
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