Skip to content

Commit a021796

Browse files
authoredJul 18, 2023
feat: remove most peer dependencies (#256)
1 parent 3de746e commit a021796

File tree

4 files changed

+193
-301
lines changed

4 files changed

+193
-301
lines changed
 

‎.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525

2626
- uses: simenandre/publish-with-pnpm@v1
2727
with:
28-
npm-auth-token: ${{ secrets.NPM_TOKEN }}
28+
npm-auth-token: ${{ secrets.NPM_TOKEN }}

‎README.md

+12-17
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,31 @@
33
A reusable Eslint config built by and maintained by Bjerk.
44

55
```shell
6-
yarn add @bjerk/eslint-config
6+
yarn add @bjerk/eslint-config eslint
77
```
88

9-
If you want help installing the bunch of peerDependencies for this package,
10-
consider using this:
9+
## Usage
1110

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

16-
Or, if you're using [pnpm], you can make it install peer dependencies
17-
automatically:
18-
19-
```shell
20-
pnpm config set auto-install-peers true --location project
14+
```javascript
15+
module.exports = {
16+
extends: '@bjerk/eslint-config',
17+
};
2118
```
2219

23-
[pnpm]: https://pnpm.io/
24-
25-
To make all this config work, you only need to add this to your Eslint
26-
configuration:
20+
To make the configuration work with Typescript, you'll need to add the
21+
`parserOptions` as follows:
2722

2823
```javascript
2924
module.exports = {
30-
extends: "@bjerk/eslint-config",
25+
extends: '@bjerk/eslint-config',
3126
parserOptions: {
3227
project: true,
3328
tsconfigRootDir: __dirname,
3429
},
35-
}
30+
};
3631
```
3732

3833
You can also use parts of this configuration if you want to. For example, if you

‎package.json

+11-18
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@
1414
"format": "prettier --write .",
1515
"lint": "eslint -c index.js --ext .ts,.tsx,.js,.jsx ."
1616
},
17-
"peerDependencies": {
17+
"dependencies": {
1818
"@typescript-eslint/eslint-plugin": "^6.0.0",
1919
"@typescript-eslint/parser": "^6.0.0",
20-
"eslint": "^7.32.0 || ^8.2.0",
2120
"eslint-config-prettier": "^8.8.0",
2221
"eslint-plugin-eslint-comments": "^3.2.0",
2322
"eslint-plugin-import": "^2.27.5",
2423
"eslint-plugin-promise": "^6.1.1",
2524
"eslint-plugin-unicorn": "^47.0.0"
2625
},
26+
"peerDependencies": {
27+
"eslint": "^7.32.0 || ^8.2.0",
28+
"prettier": "^3.0.0",
29+
"typescript": "^5.1.6"
30+
},
2731
"peerDependenciesMeta": {
2832
"prettier": {
2933
"optional": true
34+
},
35+
"typescript": {
36+
"optional": true
3037
}
3138
},
3239
"devDependencies": {
3340
"@simenandre/prettier": "^5.0.0",
34-
"@typescript-eslint/eslint-plugin": "^6.0.0",
35-
"@typescript-eslint/parser": "^6.0.0",
3641
"eslint": "^8.38.0",
37-
"eslint-config-prettier": "^8.8.0",
38-
"eslint-plugin-eslint-comments": "^3.2.0",
39-
"eslint-plugin-import": "^2.27.5",
40-
"eslint-plugin-promise": "^6.1.1",
41-
"eslint-plugin-unicorn": "^47.0.0",
4242
"prettier": "^3.0.0",
4343
"typescript": "^5.1.6"
4444
},
@@ -50,16 +50,9 @@
5050
},
5151
"packageManager": "pnpm@8.6.7",
5252
"peerDevDependencies": [
53-
"@typescript-eslint/eslint-plugin",
54-
"@typescript-eslint/parser",
5553
"eslint",
56-
"eslint-config-prettier",
57-
"eslint-plugin-eslint-comments",
58-
"eslint-plugin-import",
59-
"eslint-plugin-prettier",
60-
"eslint-plugin-promise",
61-
"eslint-plugin-unicorn",
62-
"prettier"
54+
"prettier",
55+
"typescript"
6356
],
6457
"prettier": "@simenandre/prettier",
6558
"volta": {

0 commit comments

Comments
 (0)