WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 4e2f014

Browse files
committed
docs: improve docs about typescript
1 parent 60d8463 commit 4e2f014

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

docs/typescript.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,12 @@ packageExtensions:
2020
'@types/react': '*'
2121
```
2222
23-
or by creating this `.pnpmfile.cjs`:
24-
25-
```js
26-
module.exports = {
27-
hooks: {
28-
readPackage (pkg) {
29-
if (pkg.dependencies['react'] || pkg.peerDependencies['react']) {
30-
pkg.peerDependencies['@types/react'] = '*'
31-
}
32-
return pkg
33-
}
34-
}
35-
}
23+
Alternatively, you can install a config dependency that we created to deal with these issues [`@pnpm/types-fixer`]. Run:
24+
25+
```sh
26+
pnpm add @pnpm/types-fixer --config
27+
pnpm config set pnpmfile node_modules/.pnpm-config/@pnpm/types-fixer/pnpmfile.cjs --location=project
3628
```
29+
30+
[`@pnpm/types-fixer`]: https://github.com/pnpm/types-fixer
31+

0 commit comments

Comments
 (0)