Thank you for your interest in contributing! This document provides guidelines for contributing to this project.
Before creating bug reports, please check the existing issues. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the problem
- Expected behavior vs actual behavior
- Code samples that demonstrate the issue
- Environment details (React version, Node.js version, Browser, OS)
Enhancement suggestions are welcome! Please provide:
- Clear description of the enhancement
- Use cases and why it would be useful
- Possible implementation approach (if you have ideas)
- Fork the repository and create your branch from
main - Make your changes following our coding standards
- Build and test your changes by running
npm run build - Commit your changes using Conventional Commits:
feat:for new featuresfix:for bug fixesdocs:for documentation changeschore:for maintenance tasksrefactor:for code refactoring
- Push to your fork and submit a pull request
- Node.js (latest LTS version recommended)
- npm or pnpm
# Clone your fork
git clone https://github.com/YOUR_USERNAME/image-optimize-react.git
cd image-optimize-react
# Install dependencies
npm install
# Build the library
npm run buildThis project uses ESLint and follows TypeScript best practices. Key principles:
- Line length: Maximum 120 characters
- Indentation: 4 spaces
- Quotes: Use double quotes
"or template literals` - Semicolons: Always use semicolons
- Braces: Always use braces for control structures
// Good
if (condition) {
doSomething();
}
const message = `Hello ${name}`;
// Bad
if (condition) doSomething();
const message = 'Hello ' + name;Follow Conventional Commits:
feat: add support for new ESLint rule
fix: correct TypeScript configuration issue
docs: update README with new examples
chore: upgrade dependenciesBefore submitting your PR:
# Run linter
npm run eslint
# Build the library
npm run build
# Check for security vulnerabilities
npm auditAll tests must pass before your PR can be merged.
- Automated checks run on every PR (tests, linting, security)
- Manual review by maintainers
- Feedback may be provided - please address comments
- Approval - once approved, your PR will be merged
Releases are automated:
- Maintainer merges PR to
main - Version is bumped automatically
- Changelog is generated
- NPM package is published
- GitHub release is created
- Open an issue with the
questionlabel - Check existing issues and discussions
By contributing, you agree that your contributions will be licensed under the Apache-2.0 License.
Thank you for contributing to @mts-pjsc/image-optimize! 🎉