Skip to content

Commit

Permalink
feat: remove most peer dependencies (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre authored Jul 18, 2023
1 parent 3de746e commit a021796
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 301 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:

- uses: simenandre/publish-with-pnpm@v1
with:
npm-auth-token: ${{ secrets.NPM_TOKEN }}
npm-auth-token: ${{ secrets.NPM_TOKEN }}
29 changes: 12 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,31 @@
A reusable Eslint config built by and maintained by Bjerk.

```shell
yarn add @bjerk/eslint-config
yarn add @bjerk/eslint-config eslint
```

If you want help installing the bunch of peerDependencies for this package,
consider using this:
## Usage

```shell
npx check-peer-dependencies
```
To use this config, you'll need to add an `.eslintrc.js` file to your project.
This file should export an object with the following structure:

Or, if you're using [pnpm], you can make it install peer dependencies
automatically:

```shell
pnpm config set auto-install-peers true --location project
```javascript
module.exports = {
extends: '@bjerk/eslint-config',
};
```

[pnpm]: https://pnpm.io/

To make all this config work, you only need to add this to your Eslint
configuration:
To make the configuration work with Typescript, you'll need to add the
`parserOptions` as follows:

```javascript
module.exports = {
extends: "@bjerk/eslint-config",
extends: '@bjerk/eslint-config',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
}
};
```

You can also use parts of this configuration if you want to. For example, if you
Expand Down
29 changes: 11 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@
"format": "prettier --write .",
"lint": "eslint -c index.js --ext .ts,.tsx,.js,.jsx ."
},
"peerDependencies": {
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^7.32.0 || ^8.2.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^47.0.0"
},
"peerDependencies": {
"eslint": "^7.32.0 || ^8.2.0",
"prettier": "^3.0.0",
"typescript": "^5.1.6"
},
"peerDependenciesMeta": {
"prettier": {
"optional": true
},
"typescript": {
"optional": true
}
},
"devDependencies": {
"@simenandre/prettier": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^47.0.0",
"prettier": "^3.0.0",
"typescript": "^5.1.6"
},
Expand All @@ -50,16 +50,9 @@
},
"packageManager": "pnpm@8.6.7",
"peerDevDependencies": [
"@typescript-eslint/eslint-plugin",
"@typescript-eslint/parser",
"eslint",
"eslint-config-prettier",
"eslint-plugin-eslint-comments",
"eslint-plugin-import",
"eslint-plugin-prettier",
"eslint-plugin-promise",
"eslint-plugin-unicorn",
"prettier"
"prettier",
"typescript"
],
"prettier": "@simenandre/prettier",
"volta": {
Expand Down
Loading

0 comments on commit a021796

Please sign in to comment.