Thank you for your interest in contributing to num2fa! We welcome contributions from the community to help make this package better.
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and professional in all interactions.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/num2fa.git - Install dependencies:
npm install - Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes in your feature branch
- Write or update tests as needed
- Ensure all tests pass:
npm test - Update documentation if necessary
- Format your code:
npm run format - Run linting:
npm run lint
- Update the README.md with details of changes if needed
- Ensure all tests pass and the code is properly formatted
- Submit a pull request to the
mainbranch - Your PR will be reviewed by maintainers
- Write tests for any new functionality
- Run tests with
npm test - Aim for 100% test coverage for new code
- Test both success and error cases
We use TypeScript and follow these conventions:
- Use TypeScript's strict mode
- Follow ESLint and Prettier configurations
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
Follow conventional commits format:
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style changes (formatting, etc)
- refactor: Code refactoring
- test: Adding or updating tests
- chore: Maintenance tasks
Example: feat: add support for thousands separator
# Install dependencies
npm install
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Format code
npm run format
# Lint code
npm run lint
# Build the package
npm run buildnum2fa/
├── src/
│ ├── converters/ # Converter implementations
│ ├── constants.ts # Constant values and mappings
│ └── index.ts # Public API exports
├── tests/ # Test files
├── dist/ # Compiled output
└── package.json # Package configuration
- Discuss major changes in an issue first
- Follow existing patterns and conventions
- Add tests for new functionality
- Update documentation
- Add examples if appropriate
When reporting issues, please include:
- A clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Version information
- Code examples if applicable
If you have questions about contributing, feel free to:
- Open an issue
- Ask in your pull request
- Contact the maintainers
Thank you for contributing to num2fa!