-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCUMENTATION] | Fix: remove duplicated part son the documentation
- Loading branch information
Showing
2 changed files
with
3 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,35 +10,27 @@ You might like them - or you might not. Don't worry you can always change them. | |
- Fixes issues and formatting errors with Prettier | ||
- Lints + Fixes inside of html script tags | ||
- You can see all the [rules here](https://github.com/IT-WIBRC/eslint-config-epsvue/blob/master/.eslintrc.js). You are very welcome to overwrite any of these settings, or just fork the entire thing to create your own. | ||
- You can see all the [rules here](https://github.com/IT-WIBRC/eslint-config-epsvue/blob/master/.eslintrc.js). You are very welcome to overwrite any of these settings, or just fork the entire thing to create your own. | ||
|
||
## Project setup | ||
|
||
It's recommended you install this once per every project. ESLint used to have global configs, but no longer. | ||
|
||
1. Installation | ||
1. Installation | ||
|
||
``` | ||
npm install -D [email protected].2 | ||
npm install -D [email protected].3 | ||
``` | ||
|
||
2. Extend the configuration | ||
|
||
create the `.eslintrc.*` file in the root of your project. after copy this in the file: | ||
|
||
```json | ||
{ | ||
"extends": "eslint-config-epsvue" | ||
} | ||
``` | ||
```json | ||
{ | ||
"extends": "eslint-config-epsvue" | ||
} | ||
``` | ||
|
||
3. You can add two scripts to your package.json to lint and/or fix: | ||
3. You can add two scripts to your package.json to lint and/or fix: | ||
|
||
```json | ||
|
@@ -47,28 +39,12 @@ create the `.eslintrc.*` file in the root of your project. after copy this in th | |
"lint:fix": "eslint . --fix" | ||
}, | ||
``` | ||
```json | ||
"scripts": { | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix" | ||
}, | ||
``` | ||
|
||
6. Now you can manually lint your code by running `npm run lint` and fix all fixable issues with `npm run lint:fix`. You probably want your editor to do this though. | ||
6. Now you can manually lint your code by running `npm run lint` and fix all fixable issues with `npm run lint:fix`. You probably want your editor to do this though. | ||
4. Now you can manually lint your code by running `npm run lint` and fix all fixable issues with `npm run lint:fix`. You probably want your editor to do this though. | ||
|
||
## Settings | ||
|
||
If you'd like to overwrite eslint or prettier settings, you can add the rules in your `.eslintrc` file. The [ESLint rules](https://eslint.org/docs/rules/) go directly under `"rules"`. | ||
|
||
```json | ||
{ | ||
"extends": ["eslint-config-epsvue"], | ||
"rules": { | ||
"no-console": 2 | ||
} | ||
} | ||
``` | ||
```json | ||
{ | ||
"extends": ["eslint-config-epsvue"], | ||
|
@@ -84,38 +60,16 @@ There are only 2 prettier rules included in my config - `singleQuote: true` and | |
|
||
If you want custom [prettier options](https://prettier.io/docs/en/options.html), it's recommended to create a `.prettierrc` file in your root directory like so: | ||
|
||
```json | ||
```json | ||
{ | ||
"singleQuote": true, | ||
"endOfLine": "auto", | ||
"tabWidth": 4 | ||
} | ||
{ | ||
"singleQuote": true, | ||
"endOfLine": "auto", | ||
"tabWidth": 4 | ||
} | ||
``` | ||
|
||
You can also put this in your EsLint config as a rule like so: | ||
|
||
```json | ||
{ | ||
"extends": ["eslint-config-epsvue"], | ||
"rules": { | ||
//... any eslint rules here | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"singleQuote": true, | ||
"endOfLine": "auto", | ||
"tabWidth": 4 | ||
}, | ||
], | ||
} | ||
} | ||
``` | ||
```json | ||
{ | ||
"extends": ["eslint-config-epsvue"], | ||
|
@@ -135,13 +89,6 @@ You can also put this in your EsLint config as a rule like so: | |
|
||
Note if you are switching to double quotes, you'll also need to add this eslint rule, or they will fight to the death! | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"quotes": ["error", "double"] | ||
} | ||
} | ||
``` | ||
```json | ||
{ | ||
"rules": { | ||
|
@@ -152,30 +99,21 @@ Note if you are switching to double quotes, you'll also need to add this eslint | |
|
||
## With VS Code | ||
|
||
You should read this entire thing. Serious! | ||
You should read this entire thing. Serious! | ||
|
||
Once you have done one, or both, of the above installs. You probably want your editor to lint and fix for you. Here are the instructions for VS Code: | ||
Once you have done one, or both, of the above installs. You probably want your editor to lint and fix for you. Here are the instructions for VS Code: | ||
|
||
- install `eslint` abd `prettier` extensions | ||
- If you use `vetur`, you need to do this to avoid some `eslint` issues | ||
Now we need to setup some VS Code settings via `Code/File` → `Preferences` → `Settings`. It's easier to enter these settings while editing the `settings.json` file, so click the Open (Open Settings) icon in the top right corner: | ||
Now we need to setup some VS Code settings via `Code/File` → `Preferences` → `Settings`. It's easier to enter these settings while editing the `settings.json` file, so click the Open (Open Settings) icon in the top right corner: | ||
|
||
add this : | ||
add this : | ||
|
||
```json | ||
"vetur.validation.template": false, | ||
"vetur.validation.script": false, | ||
"vetur.validation.style": false, | ||
``` | ||
```json | ||
"vetur.validation.template": false, | ||
"vetur.validation.script": false, | ||
"vetur.validation.style": false, | ||
``` | ||
|
||
## With WSL | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters