-
Notifications
You must be signed in to change notification settings - Fork 2
Major codebase improvements with Biome integration and enhanced type safety #343
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chore(deps): update all non-major dependencies
## Major Improvements 🚀 - **Linting**: Migrated from ESLint to Biome for better performance and consistency - **Type Safety**: Removed all `as any` type assertions, improved TypeScript definitions - **Documentation**: Updated README and CHANGELOG to reflect current API state - **Code Quality**: Reduced lint warnings by 55% (from 167 to 75) ## Breaking Changes - Replaced ESLint with Biome for linting and formatting - Updated TypeScript interfaces for better type compatibility - Fixed image fallback URL validation for relative URLs ## New Features - ✨ Comprehensive Biome configuration optimized for Node.js development - 🎯 Enhanced type definitions with proper interface inheritance - 🧹 Automatic import organization and Node.js protocol enforcement - 📊 Better test coverage with Jest globals support ## Technical Improvements - **Type System**: Fixed interface inconsistencies between IOgImage and IImageMetadata - **Function Signatures**: Aligned mediaSetup and fallback function types - **Import Management**: Added proper type imports and removed unused imports - **Code Style**: Applied consistent formatting and removed unnecessary type casts ## Fixes - Fixed test failures caused by incorrect `<image>` tags (changed to `<img>`) - Resolved URL validation issues for relative image paths in fallbacks - Fixed TypeScript compilation errors with proper interface definitions - Maintained 100% test coverage (77/77 tests passing) All functionality preserved while significantly improving code quality and type safety.
- Complete CHANGELOG.md with v1.1.0 detailed release notes including: * Major improvements (Biome integration, TypeScript excellence) * Breaking changes and migration guide * New features (async API, bulk processing, validation, scoring) * Security features, performance metrics, roadmap - Enhanced README.md with complete API reference: * All configuration options with detailed tables * Comprehensive feature guide (60+ meta tags, structured data) * Advanced features (caching, security, bulk processing) * Performance monitoring and validation examples * Complete return type documentation - GitHub workflow optimizations: * Added concurrency control to prevent redundant runs * Removed deprecated styfle/cancel-workflow-action * Streamlined CI/CD pipeline for better performance - Code quality improvements: * Removed biome-ignore comments where fixed * Proper TypeScript types for Cheerio elements * Cleaned up unused variables and simplified logic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR brings significant improvements to code quality, type safety, and developer experience through Biome integration and comprehensive TypeScript enhancements.
🚀 Major Improvements
Linting & Formatting Migration
Type Safety Enhancements
as any
type assertions from the codebaseIOgImage
andIImageMetadata
CacheStorage
,IValidationResult
,ISocialScore
)Documentation Updates
🔧 Technical Improvements
Interface Compatibility
IOgObjectMedia
to use properOGType
instead of genericstring
twitterImageAlt
,twitterPlayer*
) between interfacesIOgImage.url
required for consistency withIImageMetadata
IExtractionResult
with optionalvalidation
andsocialScore
fieldsBug Fixes
<image>
tags to proper<img>
tags📊 Quality Metrics
as any
assertions in main code🛠️ Biome Configuration
The new Biome setup provides excellent Node.js defaults:
node:fs
instead offs
)⚡ Performance Impact
🔄 Migration Guide
No breaking changes to the public API. The improvements are internal:
Test Plan
This PR represents a major step forward in code quality while maintaining full backward compatibility. The codebase is now more maintainable, type-safe, and developer-friendly.