Skip to content
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

Add 2.2 blog post #9589

Merged
merged 24 commits into from Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions changelog_unreleased/blog-post-intro.md
@@ -1,7 +1,7 @@
---
author: "🚧"
authorURL: "https://github.com/🚧"
title: "Prettier 🚧"
author: "Sosuke Suzuki (@sosukesuzuki)"
authorURL: "https://github.com/sosukesuzuki"
title: "Prettier 2.2: new JavaScript parsers, TS 4.1 and ESM standalone bundles"
---

🚧 Write an introduction here.
This release supports new JavaScript parsers [espree](https://github.com/eslint/espree) and [meriyah](https://github.com/meriyah/meriyah), supports [TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-rc/), ships ESM standalone bundles for modern browsers, and includes many bug fixes and improvements!
fisker marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions changelog_unreleased/cli/pr-8937.md
@@ -0,0 +1,12 @@
#### Move [pre-commit](https://github.com/pre-commit/pre-commit) support to github.com/prettier/pre-commit ([#8937](https://github.com/prettier/prettier/pull/8937) by [@FloChehab](https://github.com/FloChehab))

`pre-commit` support has moved to the new repository https://github.com/prettier/pre-commit, please update your `.pre-commit-config.yaml` file .

```diff
- - repo: https://github.com/prettier/prettier
+ - repo: https://github.com/prettier/pre-commit
- rev: "2.2.0"
+ rev: "v2.2.0"
hooks:
- id: prettier
```
42 changes: 0 additions & 42 deletions changelog_unreleased/css/pr-9209.md

This file was deleted.

26 changes: 23 additions & 3 deletions changelog_unreleased/typescript/pr-9473.md
@@ -1,8 +1,28 @@
#### [HIGHLIGHT]Support TypeScript 4.1 via Babel (#9473 by @sosukesuzuki)

`--parser=babel-ts` is required.
If you want to format [TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-rc/) features, please update your configuration file to use the `babel-ts` parser as below:

```diff
// .prettierrc
{
+ "overrides": [
+ {
+ "files": "*.ts",
+ "options": {
+ "parser": "babel-ts"
+ }
+ }
+ ]
}
```

The overrides configuration should be kept until the default `typescript` parser supports TypeScript 4.1 features. Probably it can be removed when 2.3 is released.

See documentation for [Configuration Overrides](https://prettier.io/docs/en/configuration.html#configuration-overrides) and [Parser Options](https://prettier.io/docs/en/options.html#parser) for detail.

If you don't use TypeScript 4.1, no additional configuration is required.

##### Key Remapping In Mapped Types
##### [Key Remapping In Mapped Types](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-rc/#key-remapping-in-mapped-types)

```ts
// Input
Expand All @@ -23,7 +43,7 @@ type MappedTypeWithNewKeys<T> = {
};
```

##### Template Literal Types
##### [Template Literal Types](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-rc/#template-literal-types)

```ts
// Input
Expand Down