Release 2.8.3

This commit is contained in:
fisker committed 2023-01-14 11:33:26 +08:00
1 parent 4ad9160891
commit c990e522ce
6 files changed
+56 -33

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
--> -->
**Prettier 2.8.2** **Prettier 2.8.3**
[Playground link](https://prettier.io/playground/#.....) [Playground link](https://prettier.io/playground/#.....)
```sh ```sh
+1 -1
View File
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
**Environments:** **Environments:**
- Prettier Version: 2.8.2 - Prettier Version: 2.8.3
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. --> - Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v14, Chrome v83, etc. --> - Runtime: <!-- Node.js v14, Chrome v83, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. --> - Operating System: <!-- Windows, Linux, macOS, etc. -->
+23
View File
@@ -1,3 +1,26 @@
# 2.8.3
[diff](https://github.com/prettier/prettier/compare/2.8.2...2.8.3)
#### Allow self-closing tags on custom elements ([#14170](https://github.com/prettier/prettier/pull/14170) by [@fisker](https://github.com/fisker))
See [Angular v15.1.0 release note](https://github.com/angular/angular/releases/tag/15.1.0) for details.
<!-- prettier-ignore -->
```html
// Input
<app-test/>
// Prettier 2.8.2
SyntaxError: Only void and foreign elements can be self closed "app-test" (1:1)
> 1 | <app-test/>
| ^^^^^^^^^
2 |
// Prettier 2.8.3
<app-test />
```
# 2.8.2 # 2.8.2
[diff](https://github.com/prettier/prettier/compare/2.8.1...2.8.2) [diff](https://github.com/prettier/prettier/compare/2.8.1...2.8.2)
+15 -15
View File
@@ -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 - **`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.2/> and - `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.3/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.2/esm/> - `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.3/esm/>
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option. You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
@@ -32,8 +32,8 @@ See below for examples.
### Global ### Global
```html ```html
<script src="https://unpkg.com/prettier@2.8.2/standalone.js"></script> <script src="https://unpkg.com/prettier@2.8.3/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.2/parser-graphql.js"></script> <script src="https://unpkg.com/prettier@2.8.3/parser-graphql.js"></script>
<script> <script>
prettier.format("type Query { hello: String }", { prettier.format("type Query { hello: String }", {
parser: "graphql", parser: "graphql",
@@ -48,8 +48,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
```html ```html
<script type="module"> <script type="module">
import prettier from "https://unpkg.com/prettier@2.8.2/esm/standalone.mjs"; import prettier from "https://unpkg.com/prettier@2.8.3/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.2/esm/parser-graphql.mjs"; import parserGraphql from "https://unpkg.com/prettier@2.8.3/esm/parser-graphql.mjs";
prettier.format("type Query { hello: String }", { prettier.format("type Query { hello: String }", {
parser: "graphql", parser: "graphql",
@@ -62,8 +62,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
```js ```js
define([ define([
"https://unpkg.com/prettier@2.8.2/standalone.js", "https://unpkg.com/prettier@2.8.3/standalone.js",
"https://unpkg.com/prettier@2.8.2/parser-graphql.js", "https://unpkg.com/prettier@2.8.3/parser-graphql.js",
], (prettier, ...plugins) => { ], (prettier, ...plugins) => {
prettier.format("type Query { hello: String }", { prettier.format("type Query { hello: String }", {
parser: "graphql", parser: "graphql",
@@ -88,8 +88,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
### Worker ### Worker
```js ```js
importScripts("https://unpkg.com/prettier@2.8.2/standalone.js"); importScripts("https://unpkg.com/prettier@2.8.3/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.2/parser-graphql.js"); importScripts("https://unpkg.com/prettier@2.8.3/parser-graphql.js");
prettier.format("type Query { hello: String }", { prettier.format("type Query { hello: String }", {
parser: "graphql", parser: "graphql",
plugins: prettierPlugins, plugins: prettierPlugins,
@@ -102,8 +102,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
```html ```html
<script type="module"> <script type="module">
import prettier from "https://unpkg.com/prettier@2.8.2/esm/standalone.mjs"; import prettier from "https://unpkg.com/prettier@2.8.3/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.2/esm/parser-babel.mjs"; import parserBabel from "https://unpkg.com/prettier@2.8.3/esm/parser-babel.mjs";
console.log( console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", { prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -119,9 +119,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
```html ```html
<script type="module"> <script type="module">
import prettier from "https://unpkg.com/prettier@2.8.2/esm/standalone.mjs"; import prettier from "https://unpkg.com/prettier@2.8.3/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.2/esm/parser-babel.mjs"; import parserBabel from "https://unpkg.com/prettier@2.8.3/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.2/esm/parser-html.mjs"; import parserHtml from "https://unpkg.com/prettier@2.8.3/esm/parser-html.mjs";
console.log( console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", { prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "prettier", "name": "prettier",
"version": "2.9.0-dev", "version": "2.8.3",
"description": "Prettier is an opinionated code formatter", "description": "Prettier is an opinionated code formatter",
"bin": "./bin/prettier.js", "bin": "./bin/prettier.js",
"repository": "prettier/prettier", "repository": "prettier/prettier",
@@ -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 - **`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.2/> and - `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.3/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.2/esm/> - `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.3/esm/>
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option. You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
@@ -33,8 +33,8 @@ See below for examples.
### Global ### Global
```html ```html
<script src="https://unpkg.com/prettier@2.8.2/standalone.js"></script> <script src="https://unpkg.com/prettier@2.8.3/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.2/parser-graphql.js"></script> <script src="https://unpkg.com/prettier@2.8.3/parser-graphql.js"></script>
<script> <script>
prettier.format("type Query { hello: String }", { prettier.format("type Query { hello: String }", {
parser: "graphql", parser: "graphql",
@@ -49,8 +49,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
```html ```html
<script type="module"> <script type="module">
import prettier from "https://unpkg.com/prettier@2.8.2/esm/standalone.mjs"; import prettier from "https://unpkg.com/prettier@2.8.3/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.2/esm/parser-graphql.mjs"; import parserGraphql from "https://unpkg.com/prettier@2.8.3/esm/parser-graphql.mjs";
prettier.format("type Query { hello: String }", { prettier.format("type Query { hello: String }", {
parser: "graphql", parser: "graphql",
@@ -63,8 +63,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
```js ```js
define([ define([
"https://unpkg.com/prettier@2.8.2/standalone.js", "https://unpkg.com/prettier@2.8.3/standalone.js",
"https://unpkg.com/prettier@2.8.2/parser-graphql.js", "https://unpkg.com/prettier@2.8.3/parser-graphql.js",
], (prettier, ...plugins) => { ], (prettier, ...plugins) => {
prettier.format("type Query { hello: String }", { prettier.format("type Query { hello: String }", {
parser: "graphql", parser: "graphql",
@@ -89,8 +89,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
### Worker ### Worker
```js ```js
importScripts("https://unpkg.com/prettier@2.8.2/standalone.js"); importScripts("https://unpkg.com/prettier@2.8.3/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.2/parser-graphql.js"); importScripts("https://unpkg.com/prettier@2.8.3/parser-graphql.js");
prettier.format("type Query { hello: String }", { prettier.format("type Query { hello: String }", {
parser: "graphql", parser: "graphql",
plugins: prettierPlugins, plugins: prettierPlugins,
@@ -103,8 +103,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
```html ```html
<script type="module"> <script type="module">
import prettier from "https://unpkg.com/prettier@2.8.2/esm/standalone.mjs"; import prettier from "https://unpkg.com/prettier@2.8.3/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.2/esm/parser-babel.mjs"; import parserBabel from "https://unpkg.com/prettier@2.8.3/esm/parser-babel.mjs";
console.log( console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", { prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -120,9 +120,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
```html ```html
<script type="module"> <script type="module">
import prettier from "https://unpkg.com/prettier@2.8.2/esm/standalone.mjs"; import prettier from "https://unpkg.com/prettier@2.8.3/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.2/esm/parser-babel.mjs"; import parserBabel from "https://unpkg.com/prettier@2.8.3/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.2/esm/parser-html.mjs"; import parserHtml from "https://unpkg.com/prettier@2.8.3/esm/parser-html.mjs";
console.log( console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", { prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {