Development Environment

ESLint has a very lightweight development environment that makes updating code fast and easy. This is a step-by-step guide to setting up a local development environment that will let you contribute back to the project.

Once you’ve cloned the repository, run npm install to get all the necessary dependencies:

一旦你已经 clone 了资源库，运行 npm install 获取所有必要的依赖:

$ cd eslint
$ npm install

You must be connected to the Internet for this step to work. You’ll see a lot of utilities being downloaded.

这一步必须联网才能工作。你会看到下载了大量的工具。

If you have an ESLint configuration file in your home directory (such as ~/.eslintrc.js), either delete or rename it. This will help ensure that all the tests in Step 5 pass. It will also prevent ESLint from running with an incorrect configuration in case the configuration file in your development environment becomes misnamed, moved, or deleted.

Step 3: Add the upstream source

The upstream source is the main ESLint repository that active development happens on. While you won’t have push access to upstream, you will have pull access, allowing you to pull in the latest code whenever you want.

Step 5: Run the tests

Running the tests is the best way to ensure you have correctly set up your development environment. Make sure you’re in the eslint directory and run:

运行测试是确保你正确安装了开发环境最好的方式。确保你在 eslint 文件夹下并运行:

npm test

The testing takes a few minutes to complete. If any tests fail, that likely means one or more parts of the environment setup didn’t complete correctly. The upstream tests always pass.

测试需要花费几分钟的时间完成，如果有任何的测试失败，意味着开发环境有一个或多个地方没有正确的完成设置。上游资源库是一直能通过测试的。

Reference Information

Workflow

Once you have your development environment installed, you can make and submit changes to the ESLint source files. Doing this successfully requires careful adherence to our pull-request submission workflow.