Skip to content

Commit 189def6

Browse files
committed
🐛 fix: must use peer deps for eslint plugins
ESLint plugins used by this config must also be installed within the consuming project due to limitations of ESLint: eslint/rfcs#5
1 parent 924da10 commit 189def6

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

eslint/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ GrowFlow's shared [ESLint](https://eslint.org/) configuration to apply styling a
44

55
## Usage
66

7-
Install as dev dependency:
7+
Install as a dev dependency. ESLint plugins used by this config must also be installed within your project. This is a [current limitation of ESLint](https://github.com/eslint/rfcs/pull/5). You can easily install this package and all of its peer dependencies with [install-peerdeps](https://www.npmjs.com/package/install-peerdeps):
88

99
```
10-
yarn add @growflow/eslint-config eslint prettier -D
10+
npx install-peerdeps --dev -a <auth_token> @growflow/eslint-config
1111
```
1212

13-
> Note: that you'll need a `.npmrc` file with Growflow's `NPM_TOKEN`.
13+
> Note: that you'll need a `.npmrc` file with Growflow's `NPM_TOKEN` and you'll also need to pass that token to the `install-peerdeps` CLI (since it doesn't look at the `.npmrc` for some reason).
1414
15-
You'll need to create a `.eslintrc.js` file with content similar to the following:
15+
You can then create a `.eslintrc.js` file with content similar to the following:
1616

1717
```js
1818
module.exports = {

eslint/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"@typescript-eslint/eslint-plugin": "^4.11.0",
1515
"eslint-config-airbnb": "^18.2.1",
1616
"eslint-config-airbnb-typescript": "^12.0.0",
17-
"eslint-config-prettier": "^7.1.0",
17+
"eslint-config-prettier": "^7.1.0"
18+
},
19+
"peerDependencies": {
20+
"eslint": "^7.16.0",
1821
"eslint-plugin-eslint-comments": "^3.2.0",
1922
"eslint-plugin-import": "^2.22.1",
2023
"eslint-plugin-jest": "^24.1.3",
@@ -26,11 +29,9 @@
2629
"eslint-plugin-react-hooks": "^4.2.0",
2730
"eslint-plugin-security": "^1.4.0",
2831
"eslint-plugin-simple-import-sort": "^7.0.0",
29-
"eslint-plugin-unicorn": "^24.0.0"
30-
},
31-
"peerDependencies": {
32-
"eslint": "7.x",
33-
"typescript": "4.x"
32+
"eslint-plugin-unicorn": "^24.0.0",
33+
"typescript": "^4.1.3",
34+
"prettier": "^2.2.1"
3435
},
3536
"devDependencies": {
3637
"audit-ci": "^2.5.1"

prettier/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@growflow/prettier-config",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Common prettier config for Growflow Org.",
55
"main": "index.json",
66
"scripts": {
@@ -11,6 +11,6 @@
1111
"files": [ "README.md" ],
1212
"license": "MIT",
1313
"peerDependencies": {
14-
"prettier": "2.x"
14+
"prettier": "^2.2.1"
1515
}
1616
}

0 commit comments

Comments
 (0)