Skip to content

Conversation

@cosmiccrisp
Copy link
Contributor

@cosmiccrisp cosmiccrisp commented Oct 17, 2025

  • Update the eslint-plugin
  • Fixing type errors and warning across the repo
  • Enabling npm run lint in CI

@cosmiccrisp cosmiccrisp changed the title Fixing typing issues and enabling npm run lint [DRAFT] Fixing typing issues and enabling npm run lint Oct 17, 2025
@cosmiccrisp cosmiccrisp changed the title [DRAFT] Fixing typing issues and enabling npm run lint Fixing typing warnings and errors and enabling npm run lint Oct 21, 2025
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 focuses on improving TypeScript type safety across the codebase by replacing any types with more specific type definitions, fixing typing warnings, and enabling the npm run lint command in CI. The changes enhance code maintainability and catch potential type-related bugs at compile time.

Key Changes:

  • Replaced any types with unknown, Record<string, unknown>, and specific type definitions
  • Added proper type definitions for OpenAI response types, message formats, and guardrail interfaces
  • Updated ESLint configuration to support unused variable prefixes and handle type-specific rules
  • Enabled linting in the CI pipeline

Reviewed Changes

Copilot reviewed 65 out of 66 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/vector-store.ts Replaced any with unknown in config and metadata types
src/utils/schema.ts Updated schema resolution to use unknown and proper type assertions
src/utils/parsing.ts Added OpenAI type imports and replaced any with specific response types
src/utils/output.ts Changed any to unknown for type parameters
src/utils/openai-vector-store.ts Refactored infinite loop to use explicit completion flag
src/utils/context.ts Removed unused imports and replaced any with unknown
src/utils/content.ts New utility file for content processing with proper typing
src/types.ts Added comprehensive type definitions for messages, content parts, and text-only types
src/streaming.ts Updated to use proper OpenAI response types instead of any
src/spec.ts Changed default type parameters from any to proper defaults
src/runtime.ts Updated type parameters and added proper generic constraints
src/resources/responses/responses.ts Updated message types and improved type safety
src/resources/chat/chat.ts Updated message parameter types
src/registry.ts Changed default type parameters and added type assertion for spec storage
src/evals/* Updated evaluation types to use unknown instead of any
src/client.ts Fixed Azure client type parameters
src/checks/* Updated check functions to use proper OpenAI types and better error handling
src/base-client.ts Major refactor with proper message types, content filtering, and type-safe operations
src/agents.ts Added proper type imports and interfaces for Agents SDK integration
src/tests/* Updated test files with proper type assertions and mock interfaces
package.json Updated eslint-plugin versions
.eslintrc.js Added rules for unused variable prefixes and redeclarations
.github/workflows/ci.yml Enabled lint command in CI
docs/* Updated documentation to reflect type changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@steven10a steven10a left a comment

Choose a reason for hiding this comment

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

LGTM! All examples run and tests pass. Thank you!

@steven10a steven10a merged commit e85dcde into openai:main Oct 21, 2025
1 check 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.

2 participants