Pull Requests

If you want to contribute to an ESLint repo, please use a GitHub pull request. This is the fastest way for us to evaluate your code and to merge it into the code base. Please don’t file an issue with snippets of code. Doing so means that we need to manually merge the changes in and update any appropriate tests. That decreases the likelihood that your code is going to get included in a timely manner. Please use pull requests.

Getting Started

If you’d like to work on a pull request and you’ve never submitted code before, follow these steps:

If you want to implement a breaking change or a change to the core, ensure there’s an issue that describes what you’re doing and the issue has been accepted. You can create a new issue or just indicate you’re working on an existing issue. Bug fixes, documentation changes, and other pull requests do not require an issue.

After that, you’re ready to start working on code.

Working with Code

The process of submitting a pull request is fairly straightforward and generally follows the same pattern each time:

The message summary should be a one-sentence description of the change, and it must be 72 characters in length or shorter. If the pull request addresses an issue, then the issue number should be mentioned at the end. If the commit doesn’t completely fix the issue, then use (refs #1234) instead of (fixes #1234).

Step 6: Push your changes

If you are unable to push because some references are old, do a forced push instead:

git push -f origin issue1234

Step 7: Send the pull request

Now you’re ready to send the pull request. Go to your ESLint fork and then follow the GitHub documentation on how to send a pull request.

Following Up

Once your pull request is sent, it’s time for the team to review it. As such, please make sure to:

Monitor the status of the Travis CI build for your pull request. If it fails, please investigate why. We cannot merge pull requests that fail Travis for any reason.

Respond to comments left on the pull request from team members. Remember, we want to help you land your code, so please be receptive to our feedback.

We may ask you to make changes, rebase, or squash your commits.

Updating the Commit Message

If your commit message is in the incorrect format, you’ll be asked to update it. You can do so via:

$ git commit --amend

This will open up your editor so you can make changes. After that, you’ll need to do a forced push to your branch:

$ git push origin issue1234 -f

Updating the Code

If we ask you to make code changes, there’s no need to close the pull request and create a new one. Just go back to the branch on your fork and make your changes. Then, when you’re ready, you can add your changes into the branch:

$ git add -A
$ git commit
$ git push origin issue1234

When updating the code, it’s usually better to add additional commits to your branch rather than amending the original commit, because reviewers can easily tell which changes were made in response to a particular review. When we merge pull requests, we will squash all the commits from your branch into a single commit on the master branch.

Rebasing

If your code is out-of-date, we might ask you to rebase. That means we want you to apply your changes on top of the latest upstream code. Make sure you have set up a development environment and then you can rebase using these commands:

$ git fetch upstream
$ git rebase upstream/master

You might find that there are merge conflicts when you attempt to rebase. Please resolve the conflicts and then do a forced push to your branch: