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 all 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
7 changes: 7 additions & 0 deletions changelog_unreleased/blog-post-intro.md
@@ -0,0 +1,7 @@
---
author: "Sosuke Suzuki (@sosukesuzuki)"
authorURL: "https://github.com/sosukesuzuki"
title: "Prettier 2.2: new JavaScript parsers, TS 4.1 and ESM standalone bundles"
---

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/pre-commit/mirrors-prettier ([#8937](https://github.com/prettier/prettier/pull/8937) by [@FloChehab](https://github.com/FloChehab))

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

```diff
- - repo: https://github.com/prettier/prettier
+ - repo: https://github.com/pre-commit/mirrors-prettier
- 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.

4 changes: 2 additions & 2 deletions changelog_unreleased/flow/pr-9543.md
Expand Up @@ -7,7 +7,7 @@ const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
const foo2: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<"STRING"> = a;
const foo3: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<0> = a;

// Prettier master
// Prettier stable
const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<
symbol
> = a;
Expand All @@ -18,7 +18,7 @@ const foo3: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
0
> = a;

// Prettier stable (typescript and flow parser)
// Prettier master (typescript and flow parser)
const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<symbol> = a
const foo2: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<"STRING"> = a;
const foo3: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<0> = a;
Expand Down
4 changes: 2 additions & 2 deletions changelog_unreleased/flow/pr-9563.md
Expand Up @@ -8,13 +8,13 @@ class Foo {
bar( data: Array<string>) {}
}

// Prettier master
// Prettier stable
foo/*:: <bar> */(baz);
class Foo {
bar(data: Array/*:: <string> */) {}
}

// Prettier stable
// Prettier master
foo/*:: <bar> */(baz);
class Foo {
bar(data: Array<string>) {}
Expand Down
14 changes: 7 additions & 7 deletions changelog_unreleased/typescript/pr-9473.md
@@ -1,38 +1,38 @@
#### [HIGHLIGHT]Support TypeScript 4.1 (#9473, #9636 by @sosukesuzuki)
#### [HIGHLIGHT]Support [TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/) (#9473, #9636 by @sosukesuzuki)

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

```ts
// Input
type MappedTypeWithNewKeys<T> = {
[K in keyof T as NewKeyType]: T[K]
};

// Prettier master
// Prettier stable
SyntaxError: Unexpected token, expected "]" (2:17)
1 | type MappedTypeWithNewKeys<T> = {
> 2 | [K in keyof T as NewKeyType]: T[K]
| ^
3 | };

// Prettier stable
// Prettier master
type MappedTypeWithNewKeys<T> = {
[K in keyof T as NewKeyType]: T[K]
};
```

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

```ts
// Input
type HelloWorld = `Hello, ${keyof World}`

// Prettier master
// Prettier stable
SyntaxError: Unexpected token, expected "}" (1:35)
> 1 | type HelloWorld = `Hello, ${keyof World}`
| ^

// Prettier stable
// Prettier master
type HelloWorld = `Hello, ${keyof World}`;

```
4 changes: 2 additions & 2 deletions changelog_unreleased/typescript/pr-9484.md
Expand Up @@ -5,9 +5,9 @@
// Input
foo = { bar: (a = b) };

// Prettier master
// Prettier stable
foo = { bar: a = b };

// Prettier stable
// Prettier master
foo = { bar: (a = b) };
```
6 changes: 3 additions & 3 deletions changelog_unreleased/typescript/pr-9521.md
Expand Up @@ -7,18 +7,18 @@ const name: SomeGeneric<
Pick<Config, "ONE_LONG_PROP" | "ANOTHER_LONG_PROP">
> = null;

// Prettier master (--parser=typescript)
// Prettier stable (--parser=typescript)
const name: SomeGeneric<Pick<
Config,
"ONE_LONG_PROP" | "ANOTHER_LONG_PROP"
>> = null;

// Prettier master (--parser=flow)
// Prettier stable (--parser=flow)
const name: SomeGeneric<
Pick<Config, "ONE_LONG_PROP" | "ANOTHER_LONG_PROP">
> = null;

// Prettier stable (typescript and flow parser)
// Prettier master (typescript and flow parser)
const name: SomeGeneric<
Pick<Config, "ONE_LONG_PROP" | "ANOTHER_LONG_PROP">
> = null;
Expand Down
4 changes: 2 additions & 2 deletions changelog_unreleased/typescript/pr-9551.md
Expand Up @@ -8,13 +8,13 @@ type a= {
[A in B]: C | D
}

// Prettier master
// Prettier stable
type a = {
// prettier-ignore
A in B: C | D;
};

// Prettier stable
// Prettier master
type a = {
// prettier-ignore
[A in B]: C | D
Expand Down