Skip to content

Commit

Permalink
Release 2.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Jun 26, 2021
1 parent 2faf01b commit 9a8b579
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
-->

**Prettier 2.3.1**
**Prettier 2.3.2**
[Playground link](https://prettier.io/playground/#.....)

```sh
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:

**Environments:**

- Prettier Version: 2.3.1
- Prettier Version: 2.3.2
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. -->
Expand Down
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
# 2.3.2

[diff](https://github.com/prettier/prettier/compare/2.3.1...2.3.2)

#### Fix failure on dir with trailing slash ([#11000](https://github.com/prettier/prettier/pull/11000) by [@fisker](https://github.com/fisker))

<!-- prettier-ignore -->
```console
$ ls
1.js 1.unknown

# Prettier 2.3.1
$ prettier . -l
1.js
$ prettier ./ -l
[error] No supported files were found in the directory: "./".

# Prettier 2.3.2
$ prettier ./ -l
1.js
```

#### Fix handling of parenthesis with Flow's {Optional}IndexedAccess ([#11051](https://github.com/prettier/prettier/pull/11051) by [@gkz](https://github.com/gkz))

Add parens when required.

<!-- prettier-ignore -->
```jsx
// Input
type A = (T & S)['bar'];
type B = (T | S)['bar'];
type C = (?T)['bar'];
type D = (typeof x)['bar'];
type E = (string => void)['bar'];

// Prettier 2.3.1
type A = T & S["bar"];
type B = T | S["bar"];
type C = ?T["bar"];
type D = typeof x["bar"];
type E = (string) => void["bar"];

// Prettier 2.3.2
type A = (T & S)["bar"];
type B = (T | S)["bar"];
type C = (?T)["bar"];
type D = (typeof x)["bar"];
type E = ((string) => void)["bar"];
```
#### Print override modifiers for parameter property ([#11074](https://github.com/prettier/prettier/pull/11074) by [@sosukesuzuki](https://github.com/sosukesuzuki))
<!-- prettier-ignore -->
```ts
// Input
class D extends B {
constructor(override foo: string) {
super();
}
}

// Prettier 2.3.1
class D extends B {
constructor(foo: string) {
super();
}
}

// Prettier 2.3.2
class D extends B {
constructor(override foo: string) {
super();
}
}

```
# 2.3.1
[diff](https://github.com/prettier/prettier/compare/2.3.0...2.3.1)
Expand Down
26 changes: 13 additions & 13 deletions docs/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ See below for examples.
### Global

```html
<script src="https://unpkg.com/prettier@2.3.1/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.3.1/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@2.3.2/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.3.2/parser-graphql.js"></script>
<script>
prettier.format("type Query { hello: String }", {
parser: "graphql",
Expand All @@ -48,8 +48,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack

```html
<script type="module">
import prettier from "https://unpkg.com/prettier@2.3.1/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.3.1/esm/parser-graphql.mjs";
import prettier from "https://unpkg.com/prettier@2.3.2/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.3.2/esm/parser-graphql.mjs";
prettier.format("type Query { hello: String }", {
parser: "graphql",
Expand All @@ -62,8 +62,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack

```js
define([
"https://unpkg.com/prettier@2.3.1/standalone.js",
"https://unpkg.com/prettier@2.3.1/parser-graphql.js",
"https://unpkg.com/prettier@2.3.2/standalone.js",
"https://unpkg.com/prettier@2.3.2/parser-graphql.js",
], (prettier, ...plugins) => {
prettier.format("type Query { hello: String }", {
parser: "graphql",
Expand All @@ -88,8 +88,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
### Worker

```js
importScripts("https://unpkg.com/prettier@2.3.1/standalone.js");
importScripts("https://unpkg.com/prettier@2.3.1/parser-graphql.js");
importScripts("https://unpkg.com/prettier@2.3.2/standalone.js");
importScripts("https://unpkg.com/prettier@2.3.2/parser-graphql.js");
prettier.format("type Query { hello: String }", {
parser: "graphql",
plugins: prettierPlugins,
Expand All @@ -102,8 +102,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting),

```html
<script type="module">
import prettier from "https://unpkg.com/prettier@2.3.1/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.3.1/esm/parser-babel.mjs";
import prettier from "https://unpkg.com/prettier@2.3.2/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.3.2/esm/parser-babel.mjs";
console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
Expand All @@ -119,9 +119,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser

```html
<script type="module">
import prettier from "https://unpkg.com/prettier@2.3.1/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.3.1/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.3.1/esm/parser-html.mjs";
import prettier from "https://unpkg.com/prettier@2.3.2/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.3.2/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.3.2/esm/parser-html.mjs";
console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "2.4.0-dev",
"version": "2.3.2",
"description": "Prettier is an opinionated code formatter",
"bin": "./bin/prettier.js",
"repository": "prettier/prettier",
Expand Down
26 changes: 13 additions & 13 deletions website/versioned_docs/version-stable/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ See below for examples.
### Global

```html
<script src="https://unpkg.com/prettier@2.3.1/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.3.1/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@2.3.2/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.3.2/parser-graphql.js"></script>
<script>
prettier.format("type Query { hello: String }", {
parser: "graphql",
Expand All @@ -49,8 +49,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack

```html
<script type="module">
import prettier from "https://unpkg.com/prettier@2.3.1/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.3.1/esm/parser-graphql.mjs";
import prettier from "https://unpkg.com/prettier@2.3.2/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.3.2/esm/parser-graphql.mjs";
prettier.format("type Query { hello: String }", {
parser: "graphql",
Expand All @@ -63,8 +63,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack

```js
define([
"https://unpkg.com/prettier@2.3.1/standalone.js",
"https://unpkg.com/prettier@2.3.1/parser-graphql.js",
"https://unpkg.com/prettier@2.3.2/standalone.js",
"https://unpkg.com/prettier@2.3.2/parser-graphql.js",
], (prettier, ...plugins) => {
prettier.format("type Query { hello: String }", {
parser: "graphql",
Expand All @@ -89,8 +89,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
### Worker

```js
importScripts("https://unpkg.com/prettier@2.3.1/standalone.js");
importScripts("https://unpkg.com/prettier@2.3.1/parser-graphql.js");
importScripts("https://unpkg.com/prettier@2.3.2/standalone.js");
importScripts("https://unpkg.com/prettier@2.3.2/parser-graphql.js");
prettier.format("type Query { hello: String }", {
parser: "graphql",
plugins: prettierPlugins,
Expand All @@ -103,8 +103,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting),

```html
<script type="module">
import prettier from "https://unpkg.com/prettier@2.3.1/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.3.1/esm/parser-babel.mjs";
import prettier from "https://unpkg.com/prettier@2.3.2/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.3.2/esm/parser-babel.mjs";
console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
Expand All @@ -120,9 +120,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser

```html
<script type="module">
import prettier from "https://unpkg.com/prettier@2.3.1/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.3.1/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.3.1/esm/parser-html.mjs";
import prettier from "https://unpkg.com/prettier@2.3.2/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.3.2/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.3.2/esm/parser-html.mjs";
console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
Expand Down

0 comments on commit 9a8b579

Please sign in to comment.