From 607afd7b36fcebc4c29419b509fa8779b60d0e6b Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 24 Mar 2020 00:32:35 +0200 Subject: [PATCH] Release 2.0.2 --- .github/ISSUE_TEMPLATE/formatting.md | 2 +- .github/ISSUE_TEMPLATE/integration.md | 2 +- CHANGELOG.md | 101 ++++++++++++++++++ changelog_unreleased/javascript/pr-7842.md | 21 ---- changelog_unreleased/typescript/pr-7798.md | 32 ------ changelog_unreleased/typescript/pr-7836.md | 33 ------ docs/browser.md | 12 +-- docs/install.md | 2 +- package.json | 2 +- .../versioned_docs/version-stable/browser.md | 12 +-- .../versioned_docs/version-stable/install.md | 2 +- 11 files changed, 118 insertions(+), 103 deletions(-) delete mode 100644 changelog_unreleased/javascript/pr-7842.md delete mode 100644 changelog_unreleased/typescript/pr-7798.md delete mode 100644 changelog_unreleased/typescript/pr-7836.md diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 6d8cdafc7..885dec4ab 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Tip! Don't write this stuff manually. --> -**Prettier 2.0.1** +**Prettier 2.0.2** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index f0fca7187..e5d498ce5 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 2.0.1 +- Prettier Version: 2.0.2 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index c09161d38..8951d877a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,104 @@ +# 2.0.2 + +[diff](https://github.com/prettier/prettier/compare/2.0.1...2.0.2) + +### 2.0 regressions + +#### JavaScript: Fix formatting of pseudo-elements and pseudo-classes in styled-components template literals ([#7842](https://github.com/prettier/prettier/pull/7842) by [@thorn0](https://github.com/thorn0)) + + +```jsx +// Input +const Foo = styled.div` + ${media.smallDown}::before {} +`; + +// Prettier 2.0.0 +const Foo = styled.div` + ${media.smallDown}: : before{ + } +`; + +// Prettier 2.0.2 +const Foo = styled.div` + ${media.smallDown}::before { + } +`; +``` + +#### TypeScript: Avoid trailing commas on index signatures with only one parameter ([#7836](https://github.com/prettier/prettier/pull/7836) by [@bakkot](https://github.com/bakkot)) + +TypeScript index signatures technically allow multiple parameters and trailing commas, but it's an error to have multiple parameters there, and Babel's TypeScript parser does not accept them. So Prettier now avoids putting a trailing comma there when you have only one parameter. + + +```ts +// Input +export type A = { + a?: { + [ + x: string + ]: typeof SomeLongLongLongTypeName[keyof typeof SomeLongLongLongTypeName]; + } | null; +}; + +// Prettier 2.0.0 +export type A = { + a?: { + [ + x: string, + ]: typeof SomeLongLongLongTypeName[keyof typeof SomeLongLongLongTypeName]; + } | null; +}; + +// Prettier 2.0.2 +export type A = { + a?: { + [ + x: string + ]: typeof SomeLongLongLongTypeName[keyof typeof SomeLongLongLongTypeName]; + } | null; +}; +``` + +#### Revert "markdown: fix redundant leading spaces in markdown list" ([#7847](https://github.com/prettier/prettier/pull/7847)) + +See [#7846](https://github.com/prettier/prettier/issues/7846) + +### Other changes + +#### TypeScript: Fix `prettier-ignore` in union types ([#7798](https://github.com/prettier/prettier/pull/7798) by [@thorn0](https://github.com/thorn0)) + + +```ts +// Input +export type a = + // foo + | foo1&foo2 + // prettier-ignore + | bar1&bar2 + // baz + | baz1&baz2; + +// Prettier 2.0.0 +export type a = + // foo + | foo1&foo2 + // prettier-ignore + // prettier-ignore + | (bar1 & bar2) + // baz + | (baz1 & baz2); + +// Prettier 2.0.2 +export type a = + // foo + | (foo1 & foo2) + // prettier-ignore + | bar1&bar2 + // baz + | (baz1 & baz2); +``` + # 2.0.1 [diff](https://github.com/prettier/prettier/compare/2.0.0...2.0.1) diff --git a/changelog_unreleased/javascript/pr-7842.md b/changelog_unreleased/javascript/pr-7842.md deleted file mode 100644 index 0b2e68825..000000000 --- a/changelog_unreleased/javascript/pr-7842.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Fix formatting of pseudo-elements and pseudo-classes in styled-components template literals ([#7842](https://github.com/prettier/prettier/pull/7842) by [@thorn0](https://github.com/thorn0)) - - -```jsx -// Input -const Foo = styled.div` - ${media.smallDown}::before {} -`; - -// Prettier stable -const Foo = styled.div` - ${media.smallDown}: : before{ - } -`; - -// Prettier master -const Foo = styled.div` - ${media.smallDown}::before { - } -`; -``` diff --git a/changelog_unreleased/typescript/pr-7798.md b/changelog_unreleased/typescript/pr-7798.md deleted file mode 100644 index 49ba31742..000000000 --- a/changelog_unreleased/typescript/pr-7798.md +++ /dev/null @@ -1,32 +0,0 @@ -#### Fix `prettier-ignore` in union types ([#7798](https://github.com/prettier/prettier/pull/7798) by [@thorn0](https://github.com/thorn0)) - - -```ts -// Input -export type a = - // foo - | foo1&foo2 - // prettier-ignore - | bar1&bar2 - // baz - | baz1&baz2; - -// Prettier stable -export type a = - // foo - | foo1&foo2 - // prettier-ignore - // prettier-ignore - | (bar1 & bar2) - // baz - | (baz1 & baz2); - -// Prettier master -export type a = - // foo - | (foo1 & foo2) - // prettier-ignore - | bar1&bar2 - // baz - | (baz1 & baz2); -``` diff --git a/changelog_unreleased/typescript/pr-7836.md b/changelog_unreleased/typescript/pr-7836.md deleted file mode 100644 index 8a7156fb6..000000000 --- a/changelog_unreleased/typescript/pr-7836.md +++ /dev/null @@ -1,33 +0,0 @@ -#### Avoid trailing commas on index signatures with only one parameter ([#7836](https://github.com/prettier/prettier/pull/7836) by [@bakkot](https://github.com/bakkot)) - -TypeScript index signatures technically allow multiple parameters and trailing commas, but it's an error to have multiple parameters there, and Babel's TypeScript parser does not accept them. So Prettier now avoids putting a trailing comma there when you have only one parameter. - - -```ts -// Input -export type A = { - a?: { - [ - x: string - ]: typeof SomeLongLongLongTypeName[keyof typeof SomeLongLongLongTypeName]; - } | null; -}; - -// Prettier stable -export type A = { - a?: { - [ - x: string, - ]: typeof SomeLongLongLongTypeName[keyof typeof SomeLongLongLongTypeName]; - } | null; -}; - -// Prettier master -export type A = { - a?: { - [ - x: string - ]: typeof SomeLongLongLongTypeName[keyof typeof SomeLongLongLongTypeName]; - } | null; -}; -``` diff --git a/docs/browser.md b/docs/browser.md index fd6ede1c5..db8b99763 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -16,8 +16,8 @@ See [Usage](#usage) below for examples. ### Global ```html - - + + - + +