]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/docs/user-guide/migrating-from-jscs.md
import 8.4.0 source
[pve-eslint.git] / eslint / docs / user-guide / migrating-from-jscs.md
index c5ac5f2352337c4fc0e0d91c16a1360d7784f88b..e05ee70d6251b8dab9b27298757f312e98777653 100644 (file)
@@ -15,7 +15,7 @@ Before beginning the process of migrating to ESLint, it's helpful to understand
 
 To install Polyjuice:
 
-```
+```sh
 $ npm install -g polyjuice
 ```
 
@@ -23,7 +23,7 @@ Polyjuice works with JSON configuration files, so if you're using a JavaScript o
 
 To convert your configuration file, pass in the location of your `.jscs.json` file using the `--jscs` flag:
 
-```
+```sh
 $ polyjuice --jscs .jscsrc.json > .eslintrc.json
 ```
 
@@ -31,7 +31,7 @@ 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
 $ polyjuice --jscs .jscsrc.json ./foo/.jscsrc.json > .eslintrc.json
 ```
 
@@ -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
 $ eslint --init
 ```
 
@@ -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
 $ npm install eslint-config-airbnb-base --save-dev
 ```
 
@@ -110,13 +110,13 @@ 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
 $ jscs --fix file.js
 ```
 
 ESLint has the same option:
 
-```
+```sh
 $ eslint --fix file.js
 ```
 
@@ -124,13 +124,13 @@ $ eslint --fix file.js
 
 The JSCS `--auto-configure` option created a configuration based on what it found in a given file:
 
-```
+```sh
 $ jscs --auto-configure file.js
 ```
 
 In ESLint, there's a similar option when you use `--init`. Just select "Inspect your JavaScript file(s)":
 
-```
+```sh
 $ eslint --init
 ? How would you like to configure ESLint? (Use arrow keys)
 > Answer questions about your style
@@ -142,30 +142,28 @@ $ eslint --init
 
 JSCS allows you to specify a configuration file to use on the command line using either `--config` or `-c`, such as:
 
-```
+```sh
 $ jscs --config myconfig.json file.js
 $ jscs -c myconfig.json file.js
 ```
 
 Both flags are also supported by ESLint:
 
-```
+```sh
 $ eslint --config myconfig.json file.js
 $ eslint -c myconfig.json file.js
 ```
 
-
-
 ## Piping Code Into ESLint
 
 In JSCS, you can pipe code in like this:
 
-```
+```sh
 $ cat file.js | jscs
 ```
 
 In ESLint, you can also pipe in code, but you need to use the `--stdin` flag:
 
-```
+```sh
 $ cat file.js | eslint --stdin
 ```