Release 2.1.2
This commit is contained in:
1 parent
f75844a453
commit
8eb8f9ed2d
9 files changed
+137
-130
No files matched your search
@@ -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
|
||||
|
||||
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
|
||||
|
||||
**Environments:**
|
||||
|
||||
- Prettier Version: 2.1.1
|
||||
- Prettier Version: 2.1.2
|
||||
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
|
||||
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
|
||||
- Operating System: <!-- Windows, Linux, macOS, etc. -->
|
||||
|
||||
+122
@@ -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))
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```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))
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```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))
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```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)
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#### Fix formatting for directives in fields ([#9116](https://github.com/prettier/prettier/pull/9116) by [@sosukesuzuki](https://github.com/sosukesuzuki))
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```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!
|
||||
}
|
||||
|
||||
```
|
||||
@@ -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))
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```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")}
|
||||
`;
|
||||
|
||||
```
|
||||
@@ -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))
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```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
|
||||
```
|
||||
+6
-6
@@ -18,8 +18,8 @@ See [Usage](#usage) below for examples.
|
||||
### Global
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/prettier@2.1.1/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@2.1.1/parser-graphql.js"></script>
|
||||
<script src="https://unpkg.com/prettier@2.1.2/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@2.1.2/parser-graphql.js"></script>
|
||||
<script>
|
||||
prettier.format("query { }", {
|
||||
parser: "graphql",
|
||||
@@ -46,8 +46,8 @@ prettier.format("query { }", {
|
||||
|
||||
```js
|
||||
define([
|
||||
"https://unpkg.com/prettier@2.1.1/standalone.js",
|
||||
"https://unpkg.com/prettier@2.1.1/parser-graphql.js",
|
||||
"https://unpkg.com/prettier@2.1.2/standalone.js",
|
||||
"https://unpkg.com/prettier@2.1.2/parser-graphql.js",
|
||||
], (prettier, ...plugins) => {
|
||||
prettier.format("query { }", { parser: "graphql", plugins });
|
||||
});
|
||||
@@ -66,7 +66,7 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
|
||||
### Worker
|
||||
|
||||
```js
|
||||
importScripts("https://unpkg.com/prettier@2.1.1/standalone.js");
|
||||
importScripts("https://unpkg.com/prettier@2.1.1/parser-graphql.js");
|
||||
importScripts("https://unpkg.com/prettier@2.1.2/standalone.js");
|
||||
importScripts("https://unpkg.com/prettier@2.1.2/parser-graphql.js");
|
||||
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
|
||||
```
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "prettier",
|
||||
"version": "2.2.0-dev",
|
||||
"version": "2.1.2",
|
||||
"description": "Prettier is an opinionated code formatter",
|
||||
"bin": "./bin/prettier.js",
|
||||
"repository": "prettier/prettier",
|
||||
|
||||
@@ -19,8 +19,8 @@ See [Usage](#usage) below for examples.
|
||||
### Global
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/prettier@2.1.1/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@2.1.1/parser-graphql.js"></script>
|
||||
<script src="https://unpkg.com/prettier@2.1.2/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@2.1.2/parser-graphql.js"></script>
|
||||
<script>
|
||||
prettier.format("query { }", {
|
||||
parser: "graphql",
|
||||
@@ -47,8 +47,8 @@ prettier.format("query { }", {
|
||||
|
||||
```js
|
||||
define([
|
||||
"https://unpkg.com/prettier@2.1.1/standalone.js",
|
||||
"https://unpkg.com/prettier@2.1.1/parser-graphql.js",
|
||||
"https://unpkg.com/prettier@2.1.2/standalone.js",
|
||||
"https://unpkg.com/prettier@2.1.2/parser-graphql.js",
|
||||
], (prettier, ...plugins) => {
|
||||
prettier.format("query { }", { parser: "graphql", plugins });
|
||||
});
|
||||
@@ -67,7 +67,7 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
|
||||
### Worker
|
||||
|
||||
```js
|
||||
importScripts("https://unpkg.com/prettier@2.1.1/standalone.js");
|
||||
importScripts("https://unpkg.com/prettier@2.1.1/parser-graphql.js");
|
||||
importScripts("https://unpkg.com/prettier@2.1.2/standalone.js");
|
||||
importScripts("https://unpkg.com/prettier@2.1.2/parser-graphql.js");
|
||||
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
|
||||
```
|
||||
Reference in new issue
Block a user