From 9c7cfe33c4a39cf2c23529afe02030ea7f8acf70 Mon Sep 17 00:00:00 2001 From: Ben Perlmutter <57849986+bpmutter@users.noreply.github.com> Date: Sat, 28 Jan 2023 17:53:56 -0500 Subject: [PATCH] docs: 'Source Code' content in 'Set up Development Environment' page (#16780) * docs: 'Source Code' page into 'Set up Development Environment' Resolves #16775 * delete index content --- .../src/contribute/development-environment.md | 29 +++++++++-- docs/src/contribute/index.md | 4 -- docs/src/contribute/source-code.md | 51 ------------------- 3 files changed, 26 insertions(+), 58 deletions(-) delete mode 100644 docs/src/contribute/source-code.md diff --git a/docs/src/contribute/development-environment.md b/docs/src/contribute/development-environment.md index f2d325381fe..b84af4e3274 100644 --- a/docs/src/contribute/development-environment.md +++ b/docs/src/contribute/development-environment.md @@ -15,10 +15,16 @@ Go to to download and install the latest stable version fo Most of the installers already come with [npm](https://www.npmjs.com/) but if for some reason npm doesn't work on your system, you can install it manually using the instructions on the site. -## Step 2: Fork and checkout your own ESLint repository +## Step 2: Fork and Checkout Your Own ESLint Repository Go to and click the "Fork" button. Follow the [GitHub documentation](https://help.github.com/articles/fork-a-repo) for forking and cloning. +Clone your fork: + +```shell +git clone https://github.com//eslint +``` + Once you've cloned the repository, run `npm install` to get all the necessary dependencies: ```shell @@ -28,7 +34,9 @@ npm install You must be connected to the Internet for this step to work. You'll see a lot of utilities being downloaded. -## Step 3: Add the upstream source +**Note:** It's a good idea to re-run `npm install` whenever you pull from the main repository to ensure you have the latest development dependencies. + +## Step 3: Add the Upstream Source The *upstream source* is the main ESLint repository where active development happens. 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. @@ -56,7 +64,7 @@ npm install -g generator-eslint Please see the [generator documentation](https://github.com/eslint/generator-eslint) for instructions on how to use it. -## Step 5: Run the tests +## 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: @@ -68,6 +76,21 @@ The testing takes a few minutes to complete. If any tests fail, that likely mean ## Reference Information +### Directory Structure + +The ESLint directory and file structure is as follows: + +* `bin` - executable files that are available when ESLint is installed +* `conf` - default configuration information +* `docs` - documentation for the project +* `lib` - contains the source code + * `formatters` - all source files defining formatters + * `rules` - all source files defining rules +* `tests` - the main unit test folder + * `lib` - tests for the source code + * `formatters` - tests for the formatters + * `rules` - tests for the rules + ### 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](./pull-requests). diff --git a/docs/src/contribute/index.md b/docs/src/contribute/index.md index e2644859bae..0649ecd3d7d 100644 --- a/docs/src/contribute/index.md +++ b/docs/src/contribute/index.md @@ -34,10 +34,6 @@ If you'd like to request a change other than a bug fix or new rule, this section Learn about the architecture of the ESLint project. -## [Get the Source Code](source-code) - -Before you can get started developing ESLint, you'll need to get a copy of the ESLint source code. This section explains how to do that and a little about the source code structure. - ## [Set up a Development Environment](development-environment) Developing for ESLint is a bit different than running it on the command line. This section shows you how to set up a development environment and get you ready to write code. diff --git a/docs/src/contribute/source-code.md b/docs/src/contribute/source-code.md deleted file mode 100644 index 4e807227061..00000000000 --- a/docs/src/contribute/source-code.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Get the Source Code -eleventyNavigation: - key: get the source code - parent: contribute to eslint - title: Get the Source Code - order: 5 ---- - -ESLint is hosted at [GitHub](https://github.com/eslint/eslint) and uses [Git](https://git-scm.com/) for source control. In order to obtain the source code, you must first install Git on your system. Instructions for installing and setting up Git can be found at . - -If you simply want to create a local copy of the source to play with, you can clone the main repository using this command: - -```shell -git clone git://github.com/eslint/eslint.git -``` - -If you're planning on contributing to ESLint, then it's a good idea to fork the repository. You can find instructions for forking a repository at . After forking the ESLint repository, you'll want to create a local copy of your fork. - -## Start Developing - -Before you can get started developing, you'll need to have a couple of things installed: - -* [Node.JS](https://nodejs.org) -* [npm](https://www.npmjs.com/) - -Once you have a local copy and have Node.JS and npm installed, you'll need to install the ESLint dependencies: - -```shell -cd eslint -npm install -``` - -Now when you run `eslint`, it will be running your local copy and showing your changes. - -**Note:** It's a good idea to re-run `npm install` whenever you pull from the main repository to ensure you have the latest development dependencies. - -## Directory structure - -The ESLint directory and file structure is as follows: - -* `bin` - executable files that are available when ESLint is installed -* `conf` - default configuration information -* `docs` - documentation for the project -* `lib` - contains the source code - * `formatters` - all source files defining formatters - * `rules` - all source files defining rules -* `tests` - the main unit test folder - * `lib` - tests for the source code - * `formatters` - tests for the formatters - * `rules` - tests for the rules