Thanks for wanting to contribute! It's more than welcome 🤗
As the creators and maintainers of this project, we want to ensure that usehooks-ts
lives and continues to grow and evolve. We would like to encourage everyone to help and support this library by contributing
-
Replying and handling open issues or discussions.
We get some issues and discussions, and some of them may lack necessary information. You can help out by guiding people through the process of filling out the issue template, asking for clarifying information, or pointing them to existing issues that match their description of the problem.
-
Reviewing pull requests.
Pull requests (PRs) are essential for introducing new features, fixing bugs, and improving the overall quality of the codebase. As a reviewer, your role is crucial in ensuring that each PR meets the project's standards and goals. Here are some key aspects to consider when reviewing pull requests:
-
Code Quality: Examine the changes for readability, maintainability, and adherence to coding standards. Look for any potential code smells, redundant code, or opportunities for optimization.
-
Functionality: Test the changes locally if possible to verify that they work as intended. Check if the new feature functions correctly and if the bug fixes address the reported issues.
-
Compatibility: Ensure that the changes don't introduce breaking changes or compatibility issues with existing functionality. Consider how the changes may impact other parts of the codebase and any dependent projects.
-
Documentation: Confirm that the PR includes any necessary updates to documentation, including code comments, README files, changesets, or API references.
-
Testing: Assess whether the PR includes sufficient unit tests to cover the modified code. If necessary, suggest additional test cases or improvements to the testing strategy.
-
Feedback: Provide constructive feedback to the contributor, highlighting areas for improvement and praising positive aspects of the contribution. Encourage collaboration and discussion to address any concerns or questions.
Your thorough review helps maintain the quality and stability of the project. Remember to be respectful and supportive in your feedback, fostering a positive and inclusive community for contributors.
-
-
Help people write unit-tests.
Some pull requests sent to the main repository may lack a proper test plan. These help reviewers understand how the change was tested, and can speed up the time it takes for a contribution to be accepted.
-
Improving the documentation.
Reviewing documentation updates can be as simple as checking for spelling and grammar. If you encounter situations that can be explained better in the docs, click Edit at the top of most docs pages to get started with your own contribution.
-
Contribute the to code.
Code-level contributions to
usehooks-ts
like creating or fixing a hook generally come in the form of pull requests. These are done by forking the repo and making changes locally explained below.
Here is a quick guide to doing code contributions to the library.
-
Make sure to have the right dependencies up-to-date:
"node": ">=18.17.0"
"pnpm": "^8"
-
Fork and clone the repo to your local machine:
git clone https://github.com/YOUR_GITHUB_USERNAME/usehooks-ts.git
-
Create a new branch from
master
with a meaningful name for a new feature or an issue you want to work on:git checkout -b your-meaningful-branch-name
-
Install packages by running:
pnpm install pnpm build
-
If you want to create a new hook, use the generator:
pnpm gen-hook
-
Ensure your code lints without errors and the test suite still passes.
pnpm build && pnpm lint && pnpm test
-
Try to write some unit tests to cover as much of your code as possible.
-
Push your branch:
git push -u origin your-meaningful-branch-name
-
Submit a pull request to the upstream
usehooks-ts
repository. -
Choose a descriptive title and describe your changes briefly.
Please follow the coding style of the project. usehooks-ts
uses eslint and prettier. If possible, enable their respective plugins in your editor to get real-time feedback. The linting can be run manually with the following command: pnpm lint
and pnpm prettier
.
By contributing your code to the usehooks-ts
GitHub repository, you agree to license your contribution under the MIT license.
Big thanks go to all our contributors! [Become a contributor]
This project follows the all-contributors specification (emoji key). Contributions of any kind welcome!