Thank you for considering contributing to natural-orderby
. Below you´ll find useful information for contributing including how to setup the library, how to work with it in development and how to commit.
Please note that this project is released with a Contributor Code of Conduct.
# npm
npm install
# yarn
yarn install
You will find tests for files in separate __tests__
directories. Whenever making any changes, please ensure that all existing tests pass by running yarn test
.
If you are adding a new feature or extra functionality, please also add appropriate tests.
Note: Some tests require the timezone to be set to
UTC
which is done by setting theTZ
environment variable accordingly when runningyarn test
. But unfortunately this won´t work on Windows. To pass all tests you´d have to set your timezone manually. 🙄
Before committing any changes, please run yarn lint
and yarn flow
to lint all relevant files using ESLint and Flow and receive output on any changes that you need to make.
There is also a pre-commit hook in place to lint all staged files and to format files using prettier. If any of the staged files do not conform to the eslint or flow rules, your commit will fail until you resolve all listed issues.
natural-orderby
follows this convention for commit messages and uses commitlint to adhere to it.