Skip to content

Commit 417191d

Browse files
author
Andreas Lewis
authored
docs: Remove the $ prefix in terminal commands (#15565)
1 parent 389ff34 commit 417191d

7 files changed

Lines changed: 36 additions & 37 deletions

File tree

.markdownlint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ MD004: # Unordered list style
77
MD007: # Unordered list indentation
88
indent: 4
99
MD013: false # Line length
10-
MD014: false # Dollar signs used before commands without showing output
1110
MD019: false # Multiple spaces after hash on atx style header
1211
MD021: false # Multiple spaces inside hashes on closed atx style header
1312
MD024: false # Multiple headers with the same content

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ Prerequisites: [Node.js](https://nodejs.org/) (`^12.22.0`, `^14.17.0`, or `>=16.
4848
You can install ESLint using npm:
4949

5050
```sh
51-
$ npm install eslint --save-dev
51+
npm install eslint --save-dev
5252
```
5353

5454
You should then set up a configuration file:
5555

5656
```sh
57-
$ npm init @eslint/config
57+
npm init @eslint/config
5858
```
5959

6060
After that, you can run ESLint on any file or directory like this:
6161

6262
```sh
63-
$ ./node_modules/.bin/eslint yourfile.js
63+
./node_modules/.bin/eslint yourfile.js
6464
```
6565

6666
## <a name="configuration"></a>Configuration

docs/developer-guide/contributing/pull-requests.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Details about each step are found below.
3131
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:
3232

3333
```shell
34-
$ git checkout -b issue1234
34+
git checkout -b issue1234
3535
```
3636

3737
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.
4343
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:
4444

4545
```shell
46-
$ git add -A
47-
$ git commit
46+
git add -A
47+
git commit
4848
```
4949

5050
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
150150
If your commit message is in the incorrect format, you'll be asked to update it. You can do so via:
151151

152152
```shell
153-
$ git commit --amend
153+
git commit --amend
154154
```
155155

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

158158
```shell
159-
$ git push origin issue1234 -f
159+
git push origin issue1234 -f
160160
```
161161

162162
### Updating the Code
163163

164164
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:
165165

166166
```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
170170
```
171171

172172
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
178178
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:
179179

180180
```shell
181-
$ git fetch upstream
182-
$ git rebase upstream/main
181+
git fetch upstream
182+
git rebase upstream/main
183183
```
184184

185185
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:
186186

187187
```shell
188-
$ git push origin issue1234 -f
188+
git push origin issue1234 -f
189189
```

docs/developer-guide/development-environment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Go to <https://github.com/eslint/eslint> and click the "Fork" button. Follow the
1515
Once you've cloned the repository, run `npm install` to get all the necessary dependencies:
1616

1717
```shell
18-
$ cd eslint
19-
$ npm install
18+
cd eslint
19+
npm install
2020
```
2121

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

docs/user-guide/getting-started.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ yarn add eslint --dev
2323
You should then set up a configuration file, and the easiest way to do that is:
2424

2525
```shell
26-
$ npm init @eslint/config
26+
npm init @eslint/config
2727

2828
# or
2929

30-
$ yarn create @eslint/config
30+
yarn create @eslint/config
3131
```
3232

3333
**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.
3434

3535
After that, you can run ESLint on any file or directory like this:
3636

3737
```shell
38-
$ npx eslint yourfile.js
38+
npx eslint yourfile.js
3939

4040
# or
4141

42-
$ yarn run eslint yourfile.js
42+
yarn run eslint yourfile.js
4343
```
4444

4545
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.

docs/user-guide/migrating-from-jscs.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ Before beginning the process of migrating to ESLint, it's helpful to understand
1616
To install Polyjuice:
1717

1818
```shell
19-
$ npm install -g polyjuice
19+
npm install -g polyjuice
2020
```
2121

2222
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.
2323

2424
To convert your configuration file, pass in the location of your `.jscs.json` file using the `--jscs` flag:
2525

2626
```shell
27-
$ polyjuice --jscs .jscsrc.json > .eslintrc.json
27+
polyjuice --jscs .jscsrc.json > .eslintrc.json
2828
```
2929

3030
This creates a `.eslintrc.json` with the equivalent rules from `.jscsrc.json`.
3131

3232
If you have multiple `.jscsrc.json` files, you can pass them all and Polyjuice will combine them into one `.eslintrc.json` file:
3333

3434
```shell
35-
$ polyjuice --jscs .jscsrc.json ./foo/.jscsrc.json > .eslintrc.json
35+
polyjuice --jscs .jscsrc.json ./foo/.jscsrc.json > .eslintrc.json
3636
```
3737

3838
**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).
@@ -42,7 +42,7 @@ $ polyjuice --jscs .jscsrc.json ./foo/.jscsrc.json > .eslintrc.json
4242
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:
4343

4444
```shell
45-
$ npm init @eslint/config
45+
npm init @eslint/config
4646
```
4747

4848
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`
7575
In order to get the same functionality in ESLint, you would first need to install the `eslint-config-airbnb` shareable config package:
7676

7777
```shell
78-
$ npm install eslint-config-airbnb-base --save-dev
78+
npm install eslint-config-airbnb-base --save-dev
7979
```
8080

8181
And then you would modify your configuration file like this:
@@ -111,27 +111,27 @@ Both JSCS and ESLint have command line arguments corresponding to many of their
111111
JSCS uses the `--fix` option to apply automatic fixes to code:
112112

113113
```shell
114-
$ jscs --fix file.js
114+
jscs --fix file.js
115115
```
116116

117117
ESLint has the same option:
118118

119119
```shell
120-
$ eslint --fix file.js
120+
eslint --fix file.js
121121
```
122122

123123
### `--auto-configure`
124124

125125
The JSCS `--auto-configure` option created a configuration based on what it found in a given file:
126126

127127
```shell
128-
$ jscs --auto-configure file.js
128+
jscs --auto-configure file.js
129129
```
130130

131131
In ESLint, there's a similar option when you use `--init`. Just select "Inspect your JavaScript file(s)":
132132

133133
```shell
134-
$ eslint --init
134+
eslint --init
135135
? How would you like to configure ESLint? (Use arrow keys)
136136
> Answer questions about your style
137137
Use a popular style guide
@@ -143,27 +143,27 @@ $ eslint --init
143143
JSCS allows you to specify a configuration file to use on the command line using either `--config` or `-c`, such as:
144144

145145
```shell
146-
$ jscs --config myconfig.json file.js
147-
$ jscs -c myconfig.json file.js
146+
jscs --config myconfig.json file.js
147+
jscs -c myconfig.json file.js
148148
```
149149

150150
Both flags are also supported by ESLint:
151151

152152
```shell
153-
$ eslint --config myconfig.json file.js
154-
$ eslint -c myconfig.json file.js
153+
eslint --config myconfig.json file.js
154+
eslint -c myconfig.json file.js
155155
```
156156

157157
## Piping Code Into ESLint
158158

159159
In JSCS, you can pipe code in like this:
160160

161161
```shell
162-
$ cat file.js | jscs
162+
cat file.js | jscs
163163
```
164164

165165
In ESLint, you can also pipe in code, but you need to use the `--stdin` flag:
166166

167167
```shell
168-
$ cat file.js | eslint --stdin
168+
cat file.js | eslint --stdin
169169
```

docs/user-guide/migrating-to-5.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ For compatibility, ESLint v5 will treat `ecmaFeatures: { experimentalObjectRestS
100100
Previous versions of ESLint silently ignored any nonexistent files and globs provided on the command line:
101101

102102
```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
104104
```
105105

106106
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

Comments
 (0)