Skip to content

Commit

Permalink
docs: Update shell code fences for new website (#15522)
Browse files Browse the repository at this point in the history
Fixes #15518
  • Loading branch information
olgashi committed Jan 15, 2022
1 parent 02d6426 commit 0469eb1
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
22 changes: 11 additions & 11 deletions docs/developer-guide/contributing/pull-requests.md
Expand Up @@ -30,7 +30,7 @@ Details about each step are found below.

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:

```sh
```shell
$ git checkout -b issue1234
```

Expand All @@ -42,7 +42,7 @@ You should do all of your development for the issue in this branch.

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:

```sh
```shell
$ git add -A
$ git commit
```
Expand Down Expand Up @@ -91,7 +91,7 @@ The commit message format is important because these messages are used to create

Before you send the pull request, be sure to rebase onto the upstream source. This ensures your code is running on the latest available code.

```sh
```shell
git fetch upstream
git rebase upstream/main
```
Expand All @@ -100,7 +100,7 @@ git rebase upstream/main

After rebasing, be sure to run all of the tests once again to make sure nothing broke:

```sh
```shell
npm test
```

Expand All @@ -123,13 +123,13 @@ With your code ready to go, this is a good time to double-check your submission

Next, push your changes to your clone:

```sh
```shell
git push origin issue1234
```

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

```sh
```shell
git push -f origin issue1234
```

Expand All @@ -149,21 +149,21 @@ Once your pull request is sent, it's time for the team to review it. As such, pl

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

```sh
```shell
$ 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:

```sh
```shell
$ 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:

```sh
```shell
$ git add -A
$ git commit
$ git push origin issue1234
Expand All @@ -177,13 +177,13 @@ The commit messages in subsequent commits do not need to be in any specific form

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:

```sh
```shell
$ git fetch upstream
$ git rebase upstream/main
```

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:

```sh
```shell
$ git push origin issue1234 -f
```
6 changes: 3 additions & 3 deletions docs/developer-guide/development-environment.md
Expand Up @@ -14,7 +14,7 @@ Go to <https://github.com/eslint/eslint> and click the "Fork" button. Follow the

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

```sh
```shell
$ cd eslint
$ npm install
```
Expand All @@ -27,7 +27,7 @@ The *upstream source* is the main ESLint repository where active development hap

To add the upstream source for ESLint, run the following in your repository:

```sh
```shell
git remote add upstream git@github.com:eslint/eslint.git
```

Expand All @@ -49,7 +49,7 @@ Please see the [generator documentation](https://github.com/eslint/generator-esl

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:

```sh
```shell
npm test
```

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-mixed-operators.md
Expand Up @@ -20,7 +20,7 @@ var foo = a && b || c || d;

will generate

```sh
```shell
1:13 Unexpected mix of '&&' and '||'. (no-mixed-operators)
1:18 Unexpected mix of '&&' and '||'. (no-mixed-operators)
```
Expand All @@ -31,7 +31,7 @@ var foo = a && b ? c : d;

will generate

```sh
```shell
1:13 Unexpected mix of '&&' and '?:'. (no-mixed-operators)
1:18 Unexpected mix of '&&' and '?:'. (no-mixed-operators)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/command-line-interface.md
Expand Up @@ -234,7 +234,7 @@ This option has the same effect as `--fix` with one difference: the fixes are no

Because the default formatter does not output the fixed code, you'll have to use another one (e.g. `json`) to get the fixes. Here's an example of this pattern:

```sh
```shell
getSomeText | eslint --stdin --fix-dry-run --format=json
```

Expand All @@ -251,7 +251,7 @@ This option allows you to specify the type of fixes to apply when using either `

You can specify one or more fix type on the command line. Here are some examples:

```sh
```shell
eslint --fix --fix-type suggestion .
eslint --fix --fix-type suggestion --fix-type problem .
eslint --fix --fix-type suggestion,layout .
Expand Down
6 changes: 3 additions & 3 deletions docs/user-guide/getting-started.md
Expand Up @@ -12,7 +12,7 @@ Prerequisites: [Node.js](https://nodejs.org/en/) (`^12.22.0`, `^14.17.0`, or `>=

You can install ESLint using npm or yarn:

```sh
```shell
npm install eslint --save-dev

# or
Expand All @@ -22,7 +22,7 @@ yarn add eslint --dev

You should then set up a configuration file, and the easiest way to do that is:

```sh
```shell
$ npm init @eslint/config

# or
Expand All @@ -34,7 +34,7 @@ $ yarn create @eslint/config

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

```sh
```shell
$ npx eslint yourfile.js

# or
Expand Down
26 changes: 13 additions & 13 deletions docs/user-guide/migrating-from-jscs.md
Expand Up @@ -15,23 +15,23 @@ Before beginning the process of migrating to ESLint, it's helpful to understand

To install Polyjuice:

```sh
```shell
$ npm install -g polyjuice
```

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.

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

```sh
```shell
$ polyjuice --jscs .jscsrc.json > .eslintrc.json
```

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

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

```sh
```shell
$ polyjuice --jscs .jscsrc.json ./foo/.jscsrc.json > .eslintrc.json
```

Expand All @@ -41,7 +41,7 @@ $ polyjuice --jscs .jscsrc.json ./foo/.jscsrc.json > .eslintrc.json

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:

```sh
```shell
$ npm init @eslint/config
```

Expand Down Expand Up @@ -74,7 +74,7 @@ As an example, suppose that you are using the `airbnb` preset, so your `.jscsrc`

In order to get the same functionality in ESLint, you would first need to install the `eslint-config-airbnb` shareable config package:

```sh
```shell
$ npm install eslint-config-airbnb-base --save-dev
```

Expand Down Expand Up @@ -110,27 +110,27 @@ Both JSCS and ESLint have command line arguments corresponding to many of their

JSCS uses the `--fix` option to apply automatic fixes to code:

```sh
```shell
$ jscs --fix file.js
```

ESLint has the same option:

```sh
```shell
$ eslint --fix file.js
```

### `--auto-configure`

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

```sh
```shell
$ jscs --auto-configure file.js
```

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

```sh
```shell
$ eslint --init
? How would you like to configure ESLint? (Use arrow keys)
> Answer questions about your style
Expand All @@ -142,14 +142,14 @@ $ eslint --init

JSCS allows you to specify a configuration file to use on the command line using either `--config` or `-c`, such as:

```sh
```shell
$ jscs --config myconfig.json file.js
$ jscs -c myconfig.json file.js
```

Both flags are also supported by ESLint:

```sh
```shell
$ eslint --config myconfig.json file.js
$ eslint -c myconfig.json file.js
```
Expand All @@ -158,12 +158,12 @@ $ eslint -c myconfig.json file.js

In JSCS, you can pipe code in like this:

```sh
```shell
$ cat file.js | jscs
```

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

```sh
```shell
$ cat file.js | eslint --stdin
```

0 comments on commit 0469eb1

Please sign in to comment.