- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5
Fixing typing warnings and errors and enabling npm run lint #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 anytypes withunknown,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 anywithunknownin config and metadata types | 
| src/utils/schema.ts | Updated schema resolution to use unknownand proper type assertions | 
| src/utils/parsing.ts | Added OpenAI type imports and replaced anywith specific response types | 
| src/utils/output.ts | Changed anytounknownfor 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 anywithunknown | 
| 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 anyto 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 unknowninstead ofany | 
| 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.
There was a problem hiding this 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!
npm run lintin CI