Skip to content

Commit

Permalink
feat(docs): replace npm@<7 with yarn
Browse files Browse the repository at this point in the history
closes #1254

Co-authored-by: jay-bulk <jay.bulk@proton.me>
Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com>
Co-authored-by: Greg Poole <gpoole@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 23, 2023
1 parent 5f9e457 commit 4dbc4b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ This can be achieved by:

And both pin/lock to the same version.

# npm@<7
# Yarn

`npm@<7` does not automatically install `peerDependencies`,
Yarn does not automatically install `peerDependencies`,
so if that's what you're using, install them manually.
Here is an example, but use it only for reference,
because your decisions regarding version ranges and range specifiers may vary.

```
npm install --save-dev \
yarn add --dev \
typescript@\* \
eslint@^8.0.1 \
eslint-plugin-promise@^6.0.0 \
Expand Down
6 changes: 3 additions & 3 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ test('Exported rule values do not reference eslint-config-standard ones', (t) =>
}
})

test('npm install args in readme satisfy peerDeps', async (t) => {
test('yarn install args in readme satisfy peerDeps', async (t) => {
const { pkgJson, pkgPath, ourPeerDeps } = await getPkgDetails()
const readme = (await readFile(resolve(pkgPath, '..', 'readme.md'))).toString()
const match = readme.match(/```\n(npm install .*?)```/s)
if (match === null) throw new Error()
const match = readme.match(/```\n(yarn add .*?)```/s)
if (match === null) throw new Error("couldn't find yarn add")
if (match.length === 0) throw new Error('failed to find code block')
if (match.length > 2) throw new Error('matched multiple code blocks')
const installArgRanges = Object.fromEntries(
Expand Down

0 comments on commit 4dbc4b7

Please sign in to comment.