Skip to content

Commit

Permalink
Release 2.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Apr 23, 2023
1 parent 543a9d7 commit 1b7fad5
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/formatting.md
Expand Up @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
-->

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

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

**Environments:**

- Prettier Version: 2.8.7
- Prettier Version: 2.8.8
- 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
61 changes: 61 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,64 @@
# 2.8.8

[diff](https://github.com/prettier/prettier/compare/2.8.7...2.8.8)

#### Allow decorators on private members and class expressions ([#14548](https://github.com/prettier/prettier/pull/14548) by [@fisker](https://github.com/fisker))

<!-- prettier-ignore -->
```ts
// Input
class A {
@decorator()
#privateMethod () {}
}

// Prettier 2.8.7
SyntaxError: Decorators are not valid here. (2:3)
1 | class A {
> 2 | @decorator()
| ^^^^^^^^^^^^
3 | #privateMethod () {}
4 | }

// Prettier 2.8.8
class A {
@decorator()
#privateMethod() {}
}
```

#### Allow multiple decorators on same getter/setter ([#14584](https://github.com/prettier/prettier/pull/14584) by [@fisker](https://github.com/fisker))

<!-- prettier-ignore -->
```ts
// Input
class A {
@decorator()
get foo () {}

@decorator()
set foo (value) {}
}

// Prettier 2.8.7
SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3)
3 | get foo () {}
4 |
> 5 | @decorator()
| ^^^^^^^^^^^^
6 | set foo (value) {}
7 | }

// Prettier 2.8.8
class A {
@decorator()
get foo() {}

@decorator()
set foo(value) {}
}
```

# 2.8.7

[diff](https://github.com/prettier/prettier/compare/2.8.6...2.8.7)
Expand Down
30 changes: 15 additions & 15 deletions docs/browser.md
Expand Up @@ -20,8 +20,8 @@ Required options:

- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files named

- `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.7/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.7/esm/>
- `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.8/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.8/esm/>

You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.

Expand All @@ -32,8 +32,8 @@ See below for examples.
### Global

```html
<script src="https://unpkg.com/prettier@2.8.7/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.7/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/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.8.7/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.7/esm/parser-graphql.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.8/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.8.7/standalone.js",
"https://unpkg.com/prettier@2.8.7/parser-graphql.js",
"https://unpkg.com/prettier@2.8.8/standalone.js",
"https://unpkg.com/prettier@2.8.8/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.8.7/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.7/parser-graphql.js");
importScripts("https://unpkg.com/prettier@2.8.8/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.8/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.8.7/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.7/esm/parser-babel.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.8/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.8.7/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.7/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.7/esm/parser-html.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.8/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.8/esm/parser-html.mjs";
console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "2.8.7",
"version": "2.8.8",
"description": "Prettier is an opinionated code formatter",
"bin": "./bin/prettier.js",
"repository": "prettier/prettier",
Expand Down
30 changes: 15 additions & 15 deletions website/versioned_docs/version-stable/browser.md
Expand Up @@ -21,8 +21,8 @@ Required options:

- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files named

- `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.7/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.7/esm/>
- `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.8/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.8/esm/>

You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.

Expand All @@ -33,8 +33,8 @@ See below for examples.
### Global

```html
<script src="https://unpkg.com/prettier@2.8.7/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.7/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/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.8.7/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.7/esm/parser-graphql.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.8/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.8.7/standalone.js",
"https://unpkg.com/prettier@2.8.7/parser-graphql.js",
"https://unpkg.com/prettier@2.8.8/standalone.js",
"https://unpkg.com/prettier@2.8.8/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.8.7/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.7/parser-graphql.js");
importScripts("https://unpkg.com/prettier@2.8.8/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.8/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.8.7/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.7/esm/parser-babel.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.8/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.8.7/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.7/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.7/esm/parser-html.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.8/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.8/esm/parser-html.mjs";
console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
Expand Down

0 comments on commit 1b7fad5

Please sign in to comment.