diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 6b189dac4..ba91ba43f 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.1.1** +**Prettier 2.1.2** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index 86ef35c25..73e97d703 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.1.1 +- Prettier Version: 2.1.2 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6751aaf7d..6270e1b7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,125 @@ +# 2.1.2 + +[diff](https://github.com/prettier/prettier/compare/2.1.1...2.1.2) + +#### Fix formatting for directives in fields ([#9116](https://github.com/prettier/prettier/pull/9116) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + + +```graphql +# Input +type Query { + someQuery(id: ID!, someOtherData: String!): String! @deprecated @isAuthenticated + versions: Versions! +} + + +# Prettier stable +type Query { + someQuery(id: ID!, someOtherData: String!): String! + @deprecated + @isAuthenticated + versions: Versions! +} + +# Prettier master +type Query { + someQuery(id: ID!, someOtherData: String!): String! + @deprecated + @isAuthenticated + versions: Versions! +} + +``` + +#### Fix line breaks for CSS in JS ([#9136](https://github.com/prettier/prettier/pull/9136) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + + +```js +// Input +styled.div` + // prettier-ignore + @media (aaaaaaaaaaaaa) { + z-index: ${(props) => (props.isComplete ? '1' : '0')}; + } +`; +styled.div` + ${props => getSize(props.$size.xs)} + ${props => getSize(props.$size.sm, 'sm')} + ${props => getSize(props.$size.md, 'md')} +`; + +// Prettier stable +styled.div` + // prettier-ignore + @media (aaaaaaaaaaaaa) { + z-index: ${(props) => + props.isComplete ? "1" : "0"}; + } +`; +styled.div` + ${(props) => getSize(props.$size.xs)} + ${(props) => getSize(props.$size.sm, "sm")} + ${(props) => + getSize(props.$size.md, "md")} +`; + +// Prettier master +styled.div` + // prettier-ignore + @media (aaaaaaaaaaaaa) { + z-index: ${(props) => (props.isComplete ? "1" : "0")}; + } +`; +styled.div` + ${(props) => getSize(props.$size.xs)} + ${(props) => getSize(props.$size.sm, "sm")} + ${(props) => getSize(props.$size.md, "md")} +`; + +``` + +#### Fix comment printing in mapping and sequence ([#9143](https://github.com/prettier/prettier/pull/9143), [#9169](https://github.com/prettier/prettier/pull/9169) by [@sosukesuzuki](https://github.com/sosukesuzuki), [@fisker](https://github.com/fisker), fix in `yaml-unist-parser` by [@ikatyang](https://github.com/ikatyang)) + + +```yaml +# Input +- a + # Should indent +- bb + +--- +- a: a + b: b + + # Should print one empty line before +- another + +# Prettier stable +- a +# Should indent +- bb + +--- +- a: a + b: b + + + # Should print one empty line before +- another + +# Prettier master +- a + # Should indent +- bb + +--- +- a: a + b: b + + # Should print one empty line before +- another +``` + # 2.1.1 [diff](https://github.com/prettier/prettier/compare/2.1.0...2.1.1) diff --git a/changelog_unreleased/graphql/pr-9116.md b/changelog_unreleased/graphql/pr-9116.md deleted file mode 100644 index ae07229b0..000000000 --- a/changelog_unreleased/graphql/pr-9116.md +++ /dev/null @@ -1,28 +0,0 @@ -#### Fix formatting for directives in fields ([#9116](https://github.com/prettier/prettier/pull/9116) by [@sosukesuzuki](https://github.com/sosukesuzuki)) - - -```graphql -# Input -type Query { - someQuery(id: ID!, someOtherData: String!): String! @deprecated @isAuthenticated - versions: Versions! -} - - -# Prettier stable -type Query { - someQuery(id: ID!, someOtherData: String!): String! - @deprecated - @isAuthenticated - versions: Versions! -} - -# Prettier master -type Query { - someQuery(id: ID!, someOtherData: String!): String! - @deprecated - @isAuthenticated - versions: Versions! -} - -``` diff --git a/changelog_unreleased/javascript/pr-9136.md b/changelog_unreleased/javascript/pr-9136.md deleted file mode 100644 index 39e1f545f..000000000 --- a/changelog_unreleased/javascript/pr-9136.md +++ /dev/null @@ -1,46 +0,0 @@ -#### Fix line breaks for CSS in JS ([#9136](https://github.com/prettier/prettier/pull/9136) by [@sosukesuzuki](https://github.com/sosukesuzuki)) - - -```js -// Input -styled.div` - // prettier-ignore - @media (aaaaaaaaaaaaa) { - z-index: ${(props) => (props.isComplete ? '1' : '0')}; - } -`; -styled.div` - ${props => getSize(props.$size.xs)} - ${props => getSize(props.$size.sm, 'sm')} - ${props => getSize(props.$size.md, 'md')} -`; - -// Prettier stable -styled.div` - // prettier-ignore - @media (aaaaaaaaaaaaa) { - z-index: ${(props) => - props.isComplete ? "1" : "0"}; - } -`; -styled.div` - ${(props) => getSize(props.$size.xs)} - ${(props) => getSize(props.$size.sm, "sm")} - ${(props) => - getSize(props.$size.md, "md")} -`; - -// Prettier master -styled.div` - // prettier-ignore - @media (aaaaaaaaaaaaa) { - z-index: ${(props) => (props.isComplete ? "1" : "0")}; - } -`; -styled.div` - ${(props) => getSize(props.$size.xs)} - ${(props) => getSize(props.$size.sm, "sm")} - ${(props) => getSize(props.$size.md, "md")} -`; - -``` diff --git a/changelog_unreleased/yaml/pr-9143.md b/changelog_unreleased/yaml/pr-9143.md deleted file mode 100644 index 72522b561..000000000 --- a/changelog_unreleased/yaml/pr-9143.md +++ /dev/null @@ -1,41 +0,0 @@ -#### Fix comment printing in mapping and sequence ([#9143](https://github.com/prettier/prettier/pull/9143), [#9169](https://github.com/prettier/prettier/pull/9169) by [@sosukesuzuki](https://github.com/sosukesuzuki), [@fisker](https://github.com/fisker), fix in `yaml-unist-parser` by [@ikatyang](https://github.com/ikatyang)) - - -```yaml -# Input -- a - # Should indent -- bb - ---- -- a: a - b: b - - # Should print one empty line before -- another - -# Prettier stable -- a -# Should indent -- bb - ---- -- a: a - b: b - - - # Should print one empty line before -- another - -# Prettier master -- a - # Should indent -- bb - ---- -- a: a - b: b - - # Should print one empty line before -- another -``` diff --git a/docs/browser.md b/docs/browser.md index 19c7bfbe1..6f856eb8c 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -18,8 +18,8 @@ See [Usage](#usage) below for examples. ### Global ```html - - + + - + +