-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify typescript preset/plugin scope #2399
Conversation
Deploy preview for babel ready! Built with commit 4ad7b23 |
Note that I wouldn't be opposed to it being |
docs/preset-typescript.md
Outdated
@@ -34,10 +34,15 @@ npm install --save-dev @babel/preset-typescript | |||
|
|||
### With a configuration file (Recommended) | |||
|
|||
Note that although TypeScript compiler `tsc` actively supports new JavaScript proposals such as optional chaining (`?.`), nullish coalescing (`??`) and class properties (`this.#x`), this preset does not include these features because they are not | |||
the types syntax available in TypeScript only. We recommend using `preset-env` with `preset-typescript` if you want to transpile these features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following might be confusing:
this preset does not include these features because they are not the types syntax available in TypeScript only
Maybe something like:
this preset does not include these features as it is currently only meant to support the TypeScript types syntax.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter definitely looks better.
Co-authored-by: Brian Ng <bng412@gmail.com>
e0a0e82
to
4ad7b23
Compare
Constantly we have feature requests like babel/babel#10690 babel/babel#12030 to include staged 3 features that are supported in TypeScript compilers. Since we are not making
preset-typescript
apreset-whatever-tsc-can-do
, we should clarify this point on the docs.Resolves babel/babel#12030
Fixes #2311