Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.63 KB

CONTRIBUTING.md

File metadata and controls

44 lines (30 loc) · 1.63 KB

Contributing

Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub

Project setup

  1. Fork and clone the repo
  2. $ npm install to install dependencies
  3. $ npm run validate to validate you've got it working
  4. Create a branch for your PR

Testing workflow

Have a look at test/README.md to see how testing works. Run npm run watch:test while developing. Have fun! :)

Tips for working with Joi

  • Use !! at the beginning of your custom error string to get rid of the key at the beginning of the error message. Example:
const ERROR_MSG = '!!A custom error message without a "key" in front of it'

// Look at node_modules/joi/lib/language.js to know
// which key to override in the options.language object
const schema = Joi
  .string()
  .options({ language: { string: { base: ERROR_MSG } } })

Editor setup

Please install editorconfig plugin for your preferred editor.

Committing and Pushing changes

We follow a convention for commit messages. Please follow this convention for your commit messages.

You can use commitizen to help you to follow the convention

Once you are ready to commit the changes, please use the below commands

  1. git add <files to be comitted>
  2. $ npm run commit

... and follow the instruction of the interactive prompt.