You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer-guide/contributing/pull-requests.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Details about each step are found below.
31
31
The first step to sending a pull request is to create a new branch in your ESLint fork. Give the branch a descriptive name that describes what it is you're fixing, such as:
32
32
33
33
```shell
34
-
$ git checkout -b issue1234
34
+
git checkout -b issue1234
35
35
```
36
36
37
37
You should do all of your development for the issue in this branch.
@@ -43,8 +43,8 @@ You should do all of your development for the issue in this branch.
43
43
Make the changes to the code and tests, following the [code conventions](../code-conventions.md) as you go. Once you have finished, commit the changes to your branch:
44
44
45
45
```shell
46
-
$ git add -A
47
-
$ git commit
46
+
git add -A
47
+
git commit
48
48
```
49
49
50
50
All ESLint projects follow [Conventional Commits](https://www.conventionalcommits.org/) for our commit messages. Here's an example commit message:
@@ -150,23 +150,23 @@ Once your pull request is sent, it's time for the team to review it. As such, pl
150
150
If your commit message is in the incorrect format, you'll be asked to update it. You can do so via:
151
151
152
152
```shell
153
-
$ git commit --amend
153
+
git commit --amend
154
154
```
155
155
156
156
This will open up your editor so you can make changes. After that, you'll need to do a forced push to your branch:
157
157
158
158
```shell
159
-
$ git push origin issue1234 -f
159
+
git push origin issue1234 -f
160
160
```
161
161
162
162
### Updating the Code
163
163
164
164
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:
165
165
166
166
```shell
167
-
$ git add -A
168
-
$ git commit
169
-
$ git push origin issue1234
167
+
git add -A
168
+
git commit
169
+
git push origin issue1234
170
170
```
171
171
172
172
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 `main` branch.
@@ -178,12 +178,12 @@ The commit messages in subsequent commits do not need to be in any specific form
178
178
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](../development-environment.md) and then you can rebase using these commands:
179
179
180
180
```shell
181
-
$ git fetch upstream
182
-
$ git rebase upstream/main
181
+
git fetch upstream
182
+
git rebase upstream/main
183
183
```
184
184
185
185
You might find that there are merge conflicts when you attempt to rebase. Please [resolve the conflicts](https://help.github.com/articles/resolving-merge-conflicts-after-a-git-rebase/) and then do a forced push to your branch:
Copy file name to clipboardExpand all lines: docs/developer-guide/development-environment.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@ Go to <https://github.com/eslint/eslint> and click the "Fork" button. Follow the
15
15
Once you've cloned the repository, run `npm install` to get all the necessary dependencies:
16
16
17
17
```shell
18
-
$ cd eslint
19
-
$ npm install
18
+
cd eslint
19
+
npm install
20
20
```
21
21
22
22
You must be connected to the Internet for this step to work. You'll see a lot of utilities being downloaded.
Copy file name to clipboardExpand all lines: docs/user-guide/getting-started.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,23 +23,23 @@ yarn add eslint --dev
23
23
You should then set up a configuration file, and the easiest way to do that is:
24
24
25
25
```shell
26
-
$ npm init @eslint/config
26
+
npm init @eslint/config
27
27
28
28
# or
29
29
30
-
$ yarn create @eslint/config
30
+
yarn create @eslint/config
31
31
```
32
32
33
33
**Note:**`npm init @eslint/config` assumes you have a `package.json` file already. If you don't, make sure to run `npm init` or `yarn init` beforehand.
34
34
35
35
After that, you can run ESLint on any file or directory like this:
36
36
37
37
```shell
38
-
$ npx eslint yourfile.js
38
+
npx eslint yourfile.js
39
39
40
40
# or
41
41
42
-
$ yarn run eslint yourfile.js
42
+
yarn run eslint yourfile.js
43
43
```
44
44
45
45
It is also possible to install ESLint globally rather than locally (using `npm install eslint --global`). However, this is not recommended, and any plugins or shareable configs that you use must be installed locally in either case.
Copy file name to clipboardExpand all lines: docs/user-guide/migrating-from-jscs.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,23 +16,23 @@ Before beginning the process of migrating to ESLint, it's helpful to understand
16
16
To install Polyjuice:
17
17
18
18
```shell
19
-
$ npm install -g polyjuice
19
+
npm install -g polyjuice
20
20
```
21
21
22
22
Polyjuice works with JSON configuration files, so if you're using a JavaScript or YAML JSCS configuration file, you should first convert it into a JSON configuration file.
23
23
24
24
To convert your configuration file, pass in the location of your `.jscs.json` file using the `--jscs` flag:
25
25
26
26
```shell
27
-
$ polyjuice --jscs .jscsrc.json > .eslintrc.json
27
+
polyjuice --jscs .jscsrc.json > .eslintrc.json
28
28
```
29
29
30
30
This creates a `.eslintrc.json` with the equivalent rules from `.jscsrc.json`.
31
31
32
32
If you have multiple `.jscsrc.json` files, you can pass them all and Polyjuice will combine them into one `.eslintrc.json` file:
**Note:** Polyjuice does a good job of creating a reasonable ESLint configuration from your JSCS configuration, but it may not be 100%. You may still see different warnings than you saw with JSCS, and so you may need to further modify your configuration after using Polyjuice. This is especially true if you're using inline comments to enable/disable certain rules in JSCS (you'll need to manually convert those to use ESLint-style comments instead, see "Disabling Rules Inline" later in this page).
If you don't want to convert your JSCS configuration directly into an ESLint configuration, then you can use ESLint's built-in wizard to get you started. Just run:
43
43
44
44
```shell
45
-
$ npm init @eslint/config
45
+
npm init @eslint/config
46
46
```
47
47
48
48
You'll be guided through a series of questions that will help you setup a basic configuration file to get you started.
@@ -75,7 +75,7 @@ As an example, suppose that you are using the `airbnb` preset, so your `.jscsrc`
75
75
In order to get the same functionality in ESLint, you would first need to install the `eslint-config-airbnb` shareable config package:
Copy file name to clipboardExpand all lines: docs/user-guide/migrating-to-5.0.0.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ For compatibility, ESLint v5 will treat `ecmaFeatures: { experimentalObjectRestS
100
100
Previous versions of ESLint silently ignored any nonexistent files and globs provided on the command line:
101
101
102
102
```bash
103
-
$ eslint nonexistent-file.js 'nonexistent-folder/**/*.js'# exits without any errors in ESLint v4
103
+
eslint nonexistent-file.js 'nonexistent-folder/**/*.js'# exits without any errors in ESLint v4
104
104
```
105
105
106
106
Many users found this behavior confusing, because if they made a typo in a filename, ESLint would appear to lint that file successfully while actually not linting anything.
0 commit comments