Setup your environment
git
node
and pnpm
node
and npm
. The recommended method is using the n
version
manager if you are on MacOS or Linux. Make sure you are using the
active LTS version of
Node.Next install pnpm.Fork the repository
express-rate-limit/express-rate-limit
).Once you have forked and cloned the repository, you can
pick out an issue
you want to fix/implement!Install the dependencies
pnpm install --frozen-lockfile
to install the JavaScript dependencies.If there are errors, try deleting the node_modules
folder first, then re-run
the install command.Create a branch
~/Code/express-rate-limit
) and picked the issue you want to tackle, create a
branch based off the main
branch:Writing code
typescript
and supports node
versions 16, 18
and 20. The code is arranged as follows:Code Structure
Documentation and testing
npm test
. Note that running
npm run format
will automatically resolve most style/lint issues.npm run test:ext
.Making a commit
commit-message
, try to follow the below guidelines:type:
, where type
is one of the following
depending on what the commit does:
fix
: Introduces a bug fix.feat
: Adds a new feature.test
: Any change related to tests.perf
: Any performance related change.meta
: Any change related to the build process, workflows, issue
templates, etc.refc
: Any refactoring work.docs
: Any documentation related changes.husky
and lint-staged
will automatically lint the
code and fix most issues. In case an error is not automatically fixable, they
will cancel the commit. Please fix the errors before committing the changes. If
you still wish to commit the changes, prefix the git commit
command with
HUSKY=0
, like so:Pushing your changes
main
branch of the
express-rate-limit/express-rate-limit
repository, you may wish to merge those
changes into your branch. To do so, run:main
branch of the
express-rate-limit/express-rate-limit
repository to the current branch. If you
encounter any merge conflicts, follow
this guide
to resolve them.Opening a pull request
This contributing guide was inspired by the Electron project’s contributing guide.