You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**What's the problem this PR addresses?**
<!-- Describe the rationale of your PR. -->
<!-- Link all issues that it closes. (Closes/Resolves #xxxx.) -->
Given the following monorepo setup, `plugin-typescript` is currently not
enabled by default in the `foo` workspace, as it only checks that a
`tsconfig.json` exists at the root of the project:
```
package.json
workspace/foo/package.json
workspace/foo/tsconfig.json
```
I also found the [current `README` of
`plugin-typescript`](https://github.com/yarnpkg/berry/blob/daa574791b3b2df01e76c1fdfd9c975050a0fb9d/packages/plugin-typescript/README.md)
not to be helpful in diagnosing my issue
**How did you fix it?**
<!-- A detailed description of your implementation. -->
I've added a check to see if the current workspace had a `tsconfig.json`
I've also added a Configuration section to
`plugin-typescript/README.md`, to help users find the
`tsEnableAutoTypes` option.
**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.
- I have only bumped `@yarnpkg/plugin-typescript` and `@yarnpkg/cli`,
let me know if I should also select the other plugins/core etc.
<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
Copy file name to clipboardExpand all lines: packages/docusaurus/static/configuration/yarnrc.json
+1-1
Original file line number
Diff line number
Diff line change
@@ -835,7 +835,7 @@
835
835
"tsEnableAutoTypes": {
836
836
"_package": "@yarnpkg/plugin-typescript",
837
837
"title": "Define whether to automatically install @types dependencies.",
838
-
"description": "If true, Yarn will automatically add `@types` dependencies when running `yarn add` with packages that don't provide their own typings (as reported by the Algolia npm database). This behavior is enabled by default if you have a tsconfig file at the root of your project.",
838
+
"description": "If true, Yarn will automatically add `@types` dependencies when running `yarn add` with packages that don't provide their own typings (as reported by the Algolia npm database). This behavior is enabled by default if you have a tsconfig.json file at the root of your project, or in your current workspace.",
Copy file name to clipboardExpand all lines: packages/plugin-typescript/README.md
+4
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,10 @@
9
9
10
10
This plugin is included by default starting from Yarn 4.
11
11
12
+
## Configuration
13
+
14
+
This plugin is enabled by default if you have a `tsconfig.json` file at the root of your project, or in your current workspace. See [`tsEnableAutoTypes`](https://yarnpkg.com/configuration/yarnrc#tsEnableAutoTypes) for more information.
0 commit comments