Thank you for your interest in contributing to sprintf.js! We value contributions from the community to enhance this lightweight JavaScript library for string formatting. Whether you're fixing bugs, adding features, improving documentation, or optimizing performance, your efforts are greatly appreciated.
By participating in this project, you agree to adhere to our Code of Conduct. Please review it before engaging with the community.
To contribute effectively, ensure you have:
- A basic understanding of Git and GitHub workflows
- Familiarity with JavaScript (ES6+) and Node.js development
- Installed Node.js (v10.x or higher) and npm/yarn
- A local development environment for testing changes
To report an issue:
- Review the existing issues to avoid duplicates, or open a ticket on the support page.
- Provide detailed information, including:
- Steps to reproduce the issue
- Expected and actual behavior
- Relevant error logs or stack traces (if available)
- Environment details (e.g., Node.js version, browser version)
To propose a new feature, open an issue and include:
- The problem your feature addresses
- A clear and concise description of the proposed solution
- Relevant use cases or examples
To submit a pull request (PR):
- Fork the repository.
- Create a descriptive branch:
git checkout -b feat/your-feature-nameorfix/your-bug-name - Commit your changes with meaningful messages.
- Push your branch:
git push origin your-branch-name - Open a PR with a clear title and detailed description.
- Ensure your changes pass all linting and tests:
- Run
npm run lintto check for code style issues. - Run
npm testto ensure all tests pass.
- Run
- Update relevant documentation (e.g., README, inline comments) as needed.
- Submit your PR for review. Maintainers may request changes.
- Once approved, your contribution will be merged into the project.
- Follow best practices for JavaScript, including ES6+ syntax.
- Adhere to the project's ESLint rules (configured in
.eslintrc.js). - Use descriptive and meaningful names for variables and functions.
- Add comments to clarify complex logic.
- Write in present tense (e.g., "Add feature" instead of "Added feature").
- Limit the first line to 72 characters.
- Provide additional details in the body if necessary.
To ensure the quality of your contributions:
- Write unit tests for new features or bug fixes.
- Run
npm testto execute the test suite. - Validate edge cases, such as different placeholder formats or invalid input.
- Confirm that your changes do not introduce breaking changes.
By contributing to this project, you agree that your work will be licensed under the project's BSD 3-Clause License.
We value and acknowledge significant contributions. Contributors may be recognized in:
- The project's README
- Release notes
- A dedicated "Contributors" section
If you have any questions or need assistance, feel free to reach out via: