Skip to content

Commit 407b4fb

Browse files
committed
docs(readme): add examples
1 parent 269e3be commit 407b4fb

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,49 @@ npm install --save-dev syncpack@alpha
1919

2020
> All command line options can be combined to target packages and dependencies in multiple ways.
2121
22-
### [lint](https://jamiemason.github.io/syncpack/command/lint) and [fix](https://jamiemason.github.io/syncpack/command/fix)
22+
### [lint](https://jamiemason.github.io/syncpack/command/lint)
2323

24-
Ensure that multiple packages requiring the same dependency define the same version, so that every package requires eg. `react@16.4.2`, instead of a combination of `react@16.4.2`, `react@0.15.9`, and `react@16.0.0`.
24+
Ensure that multiple packages requiring the same dependency define the same version, so that every package requires eg. `react@17.0.2`, instead of a combination of `react@17.0.2`, `react@16.8.3`, and `react@16.14.0`.
2525

2626
#### Examples
2727

2828
```bash
29-
# Find every issue in "dependencies" or "devDependencies"
29+
# Find all issues in "dependencies" or "devDependencies"
3030
syncpack lint --dependency-types prod,dev
31+
# Only lint issues in "react" specifically
32+
syncpack lint --dependencies react
3133
# Look for issues in dependencies containing "react" in the name
3234
syncpack lint --dependencies '**react**'
33-
# Autofix the above issues
34-
syncpack fix --dependencies '**react**'
35+
# Find issues in scoped packages only
36+
syncpack lint --dependencies '@types/**'
3537
# Find issues everywhere except "peerDependencies"
3638
syncpack lint --dependency-types '!peer'
37-
# Only look for issues where an exact version is used
38-
syncpack lint --specifier-types exact
39-
# Only look for issues where an exact version is specified
39+
# Only look for issues where an exact version is used (eg "1.2.3")
4040
syncpack lint --specifier-types exact
4141
# Sort dependencies by how many times they are used
4242
syncpack lint --sort count
43-
# Show a lot more detail about the issues
44-
syncpack lint --show hints,ignored,instances,statuses
4543
# See more examples
4644
syncpack lint --help
47-
syncpack fix --help
4845
# See a short summary of options
4946
syncpack lint -h
47+
```
48+
49+
### [fix](https://jamiemason.github.io/syncpack/command/fix)
50+
51+
Fix every autofixable issue found by `syncpack lint`.
52+
53+
#### Examples
54+
55+
```bash
56+
# Only fix issues in dependencies and devDependencies
57+
syncpack fix --dependency-types prod,dev
58+
# Only fix inconsistencies with exact versions (eg "1.2.3")
59+
syncpack fix --specifier-types exact
60+
# Only fix issues in "react" specifically
61+
syncpack fix --dependencies react
62+
# See more examples
63+
syncpack fix --help
64+
# See a short summary of options
5065
syncpack fix -h
5166
```
5267

0 commit comments

Comments
 (0)