Release 2.0.2

This commit is contained in:
Georgii Dolzhykov committed 2020-03-24 00:32:35 +02:00
1 parent cfb6166296
commit 607afd7b36
11 files changed
+118 -103

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
**Environments:**
- Prettier Version: 2.0.1
- Prettier Version: 2.0.2
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v6, Chrome v67, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. -->
+101
View File
@@ -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))
<!-- prettier-ignore -->
```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.
<!-- prettier-ignore -->
```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))
<!-- prettier-ignore -->
```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)
@@ -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))
<!-- prettier-ignore -->
```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 {
}
`;
```
@@ -1,32 +0,0 @@
#### Fix `prettier-ignore` in union types ([#7798](https://github.com/prettier/prettier/pull/7798) by [@thorn0](https://github.com/thorn0))
<!-- prettier-ignore -->
```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);
```
@@ -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.
<!-- prettier-ignore -->
```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;
};
```
+6 -6
View File
@@ -16,8 +16,8 @@ See [Usage](#usage) below for examples.
### Global
```html
<script src="https://unpkg.com/prettier@2.0.1/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.0.1/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@2.0.2/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.0.2/parser-graphql.js"></script>
<script>
prettier.format("query { }", {
parser: "graphql",
@@ -42,8 +42,8 @@ prettier.format("query { }", {
```js
define([
"https://unpkg.com/prettier@2.0.1/standalone.js",
"https://unpkg.com/prettier@2.0.1/parser-graphql.js",
"https://unpkg.com/prettier@2.0.2/standalone.js",
"https://unpkg.com/prettier@2.0.2/parser-graphql.js",
], (prettier, ...plugins) => {
prettier.format("query { }", { parser: "graphql", plugins });
});
@@ -62,7 +62,7 @@ This syntax doesn't necessarily work in the browser, but it can be used when bun
### Worker
```js
importScripts("https://unpkg.com/prettier@2.0.1/standalone.js");
importScripts("https://unpkg.com/prettier@2.0.1/parser-graphql.js");
importScripts("https://unpkg.com/prettier@2.0.2/standalone.js");
importScripts("https://unpkg.com/prettier@2.0.2/parser-graphql.js");
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
```
+1 -1
View File
@@ -24,5 +24,5 @@ npm install --global prettier
If you use `npx` to run Prettier, the version should be pinned like this:
```bash
npx prettier@2.0.1 . --write
npx prettier@2.0.2 . --write
```
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "2.1.0-dev",
"version": "2.0.2",
"description": "Prettier is an opinionated code formatter",
"bin": "./bin/prettier.js",
"repository": "prettier/prettier",
@@ -17,8 +17,8 @@ See [Usage](#usage) below for examples.
### Global
```html
<script src="https://unpkg.com/prettier@2.0.1/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.0.1/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@2.0.2/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.0.2/parser-graphql.js"></script>
<script>
prettier.format("query { }", {
parser: "graphql",
@@ -43,8 +43,8 @@ prettier.format("query { }", {
```js
define([
"https://unpkg.com/prettier@2.0.1/standalone.js",
"https://unpkg.com/prettier@2.0.1/parser-graphql.js",
"https://unpkg.com/prettier@2.0.2/standalone.js",
"https://unpkg.com/prettier@2.0.2/parser-graphql.js",
], (prettier, ...plugins) => {
prettier.format("query { }", { parser: "graphql", plugins });
});
@@ -63,7 +63,7 @@ This syntax doesn't necessarily work in the browser, but it can be used when bun
### Worker
```js
importScripts("https://unpkg.com/prettier@2.0.1/standalone.js");
importScripts("https://unpkg.com/prettier@2.0.1/parser-graphql.js");
importScripts("https://unpkg.com/prettier@2.0.2/standalone.js");
importScripts("https://unpkg.com/prettier@2.0.2/parser-graphql.js");
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
```
@@ -25,5 +25,5 @@ npm install --global prettier
If you use `npx` to run Prettier, the version should be pinned like this:
```bash
npx prettier@2.0.1 . --write
npx prettier@2.0.2 . --write
```