Skip to content

Commit

Permalink
馃悰 fix: must use peer deps for eslint plugins
Browse files Browse the repository at this point in the history
ESLint plugins used by this config must also be installed within the consuming project due to limitations of ESLint:
eslint/rfcs#5
  • Loading branch information
chadly committed Dec 22, 2020
1 parent 924da10 commit 189def6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions eslint/README.md
Expand Up @@ -4,15 +4,15 @@ GrowFlow's shared [ESLint](https://eslint.org/) configuration to apply styling a

## Usage

Install as dev dependency:
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):

```
yarn add @growflow/eslint-config eslint prettier -D
npx install-peerdeps --dev -a <auth_token> @growflow/eslint-config
```

> Note: that you'll need a `.npmrc` file with Growflow's `NPM_TOKEN`.
> 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).
You'll need to create a `.eslintrc.js` file with content similar to the following:
You can then create a `.eslintrc.js` file with content similar to the following:

```js
module.exports = {
Expand Down
13 changes: 7 additions & 6 deletions eslint/package.json
Expand Up @@ -14,7 +14,10 @@
"@typescript-eslint/eslint-plugin": "^4.11.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^12.0.0",
"eslint-config-prettier": "^7.1.0",
"eslint-config-prettier": "^7.1.0"
},
"peerDependencies": {
"eslint": "^7.16.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
Expand All @@ -26,11 +29,9 @@
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unicorn": "^24.0.0"
},
"peerDependencies": {
"eslint": "7.x",
"typescript": "4.x"
"eslint-plugin-unicorn": "^24.0.0",
"typescript": "^4.1.3",
"prettier": "^2.2.1"
},
"devDependencies": {
"audit-ci": "^2.5.1"
Expand Down
4 changes: 2 additions & 2 deletions prettier/package.json
@@ -1,6 +1,6 @@
{
"name": "@growflow/prettier-config",
"version": "1.0.0",
"version": "1.0.1",
"description": "Common prettier config for Growflow Org.",
"main": "index.json",
"scripts": {
Expand All @@ -11,6 +11,6 @@
"files": [ "README.md" ],
"license": "MIT",
"peerDependencies": {
"prettier": "2.x"
"prettier": "^2.2.1"
}
}

0 comments on commit 189def6

Please sign in to comment.