Skip to content

Commit

Permalink
fix(eslint): upgrade eslint config for prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
liangchunn committed Mar 31, 2021
1 parent 0299442 commit 6b64b84
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"parser": "babel-eslint",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"prettier"
"plugin:prettier/recommended"
],
"plugins": [
"import"
Expand Down Expand Up @@ -35,8 +34,6 @@
},
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"plugins": [
Expand Down
36 changes: 36 additions & 0 deletions docs/adding-prettier.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Adding Prettier

## Adding Prettier Into Your Project


### Version `<4.1.0`
> This feature is available starting from version 3 of `typescript-node-scripts`
1. In your project folder, install Prettier and the ESLint plugins:
Expand Down Expand Up @@ -41,3 +43,37 @@ yarn add prettier eslint-plugin-prettier eslint-config-prettier --dev
]
}
```

### Version `>=4.1.0`

1. In your project folder, install Prettier and the ESLint plugins:

```sh
# npm
npm i -D prettier eslint-plugin-prettier eslint-config-prettier

# yarn
yarn add prettier eslint-plugin-prettier eslint-config-prettier --dev
```

2. Add the plugins to your `.eslintrc.json`

```diff
{
"parser": "babel-eslint",
"extends": [
"eslint:recommended",
+ "plugin:prettier/recommended"
],
...
"overrides": [
{
...
"extends": [
"plugin:@typescript-eslint/recommended",
+ "plugin:prettier/recommended"
],
}
]
}
```

0 comments on commit 6b64b84

Please sign in to comment.