Skip to content

Commit

Permalink
[DOCUMENTATION] | Fix: remove duplicated part son the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
IT-WIBRC committed Nov 13, 2024
1 parent 554dab6 commit 02d44b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 65 deletions.
66 changes: 2 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"],
Expand All @@ -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"],
Expand All @@ -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": {
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-epsvue",
"version": "1.0.2",
"version": "1.0.3",
"description": "A reusable and shareable `eslint, prettier and stylelint` configuration for Vue project",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 02d44b7

Please sign in to comment.