Skip to content

Commit cba25e6

Browse files
committed
Release 2.6.0
1 parent 4cae7e1 commit cba25e6

File tree

12 files changed

+106
-90
lines changed

12 files changed

+106
-90
lines changed

.github/ISSUE_TEMPLATE/formatting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
2626
2727
-->
2828

29-
**Prettier 2.5.1**
29+
**Prettier 2.6.0**
3030
[Playground link](https://prettier.io/playground/#.....)
3131

3232
```sh

.github/ISSUE_TEMPLATE/integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
2020

2121
**Environments:**
2222

23-
- Prettier Version: 2.5.1
23+
- Prettier Version: 2.6.0
2424
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
2525
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
2626
- Operating System: <!-- Windows, Linux, macOS, etc. -->

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.6.0
2+
3+
[diff](https://github.com/prettier/prettier/compare/2.5.1...2.6.0)
4+
5+
🔗 [Release Notes](https://prettier.io/blog/2022/03/16/2.6.0.html)
6+
17
# 2.5.1
28

39
[diff](https://github.com/prettier/prettier/compare/2.5.0...2.5.1)

docs/browser.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ See below for examples.
3232
### Global
3333

3434
```html
35-
<script src="https://unpkg.com/prettier@2.5.1/standalone.js"></script>
36-
<script src="https://unpkg.com/prettier@2.5.1/parser-graphql.js"></script>
35+
<script src="https://unpkg.com/prettier@2.6.0/standalone.js"></script>
36+
<script src="https://unpkg.com/prettier@2.6.0/parser-graphql.js"></script>
3737
<script>
3838
prettier.format("type Query { hello: String }", {
3939
parser: "graphql",
@@ -48,8 +48,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
4848

4949
```html
5050
<script type="module">
51-
import prettier from "https://unpkg.com/prettier@2.5.1/esm/standalone.mjs";
52-
import parserGraphql from "https://unpkg.com/prettier@2.5.1/esm/parser-graphql.mjs";
51+
import prettier from "https://unpkg.com/prettier@2.6.0/esm/standalone.mjs";
52+
import parserGraphql from "https://unpkg.com/prettier@2.6.0/esm/parser-graphql.mjs";
5353
5454
prettier.format("type Query { hello: String }", {
5555
parser: "graphql",
@@ -62,8 +62,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
6262

6363
```js
6464
define([
65-
"https://unpkg.com/prettier@2.5.1/standalone.js",
66-
"https://unpkg.com/prettier@2.5.1/parser-graphql.js",
65+
"https://unpkg.com/prettier@2.6.0/standalone.js",
66+
"https://unpkg.com/prettier@2.6.0/parser-graphql.js",
6767
], (prettier, ...plugins) => {
6868
prettier.format("type Query { hello: String }", {
6969
parser: "graphql",
@@ -88,8 +88,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
8888
### Worker
8989

9090
```js
91-
importScripts("https://unpkg.com/prettier@2.5.1/standalone.js");
92-
importScripts("https://unpkg.com/prettier@2.5.1/parser-graphql.js");
91+
importScripts("https://unpkg.com/prettier@2.6.0/standalone.js");
92+
importScripts("https://unpkg.com/prettier@2.6.0/parser-graphql.js");
9393
prettier.format("type Query { hello: String }", {
9494
parser: "graphql",
9595
plugins: prettierPlugins,
@@ -102,8 +102,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
102102

103103
```html
104104
<script type="module">
105-
import prettier from "https://unpkg.com/prettier@2.5.1/esm/standalone.mjs";
106-
import parserBabel from "https://unpkg.com/prettier@2.5.1/esm/parser-babel.mjs";
105+
import prettier from "https://unpkg.com/prettier@2.6.0/esm/standalone.mjs";
106+
import parserBabel from "https://unpkg.com/prettier@2.6.0/esm/parser-babel.mjs";
107107
108108
console.log(
109109
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -119,9 +119,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
119119

120120
```html
121121
<script type="module">
122-
import prettier from "https://unpkg.com/prettier@2.5.1/esm/standalone.mjs";
123-
import parserBabel from "https://unpkg.com/prettier@2.5.1/esm/parser-babel.mjs";
124-
import parserHtml from "https://unpkg.com/prettier@2.5.1/esm/parser-html.mjs";
122+
import prettier from "https://unpkg.com/prettier@2.6.0/esm/standalone.mjs";
123+
import parserBabel from "https://unpkg.com/prettier@2.6.0/esm/parser-babel.mjs";
124+
import parserHtml from "https://unpkg.com/prettier@2.6.0/esm/parser-html.mjs";
125125
126126
console.log(
127127
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prettier",
3-
"version": "2.6.0-dev",
3+
"version": "2.6.0",
44
"description": "Prettier is an opinionated code formatter",
55
"bin": "./bin/prettier.js",
66
"repository": "prettier/prettier",

website/versioned_docs/version-stable/browser.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ See below for examples.
3333
### Global
3434

3535
```html
36-
<script src="https://unpkg.com/prettier@2.5.1/standalone.js"></script>
37-
<script src="https://unpkg.com/prettier@2.5.1/parser-graphql.js"></script>
36+
<script src="https://unpkg.com/prettier@2.6.0/standalone.js"></script>
37+
<script src="https://unpkg.com/prettier@2.6.0/parser-graphql.js"></script>
3838
<script>
3939
prettier.format("type Query { hello: String }", {
4040
parser: "graphql",
@@ -49,8 +49,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
4949

5050
```html
5151
<script type="module">
52-
import prettier from "https://unpkg.com/prettier@2.5.1/esm/standalone.mjs";
53-
import parserGraphql from "https://unpkg.com/prettier@2.5.1/esm/parser-graphql.mjs";
52+
import prettier from "https://unpkg.com/prettier@2.6.0/esm/standalone.mjs";
53+
import parserGraphql from "https://unpkg.com/prettier@2.6.0/esm/parser-graphql.mjs";
5454
5555
prettier.format("type Query { hello: String }", {
5656
parser: "graphql",
@@ -63,8 +63,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
6363

6464
```js
6565
define([
66-
"https://unpkg.com/prettier@2.5.1/standalone.js",
67-
"https://unpkg.com/prettier@2.5.1/parser-graphql.js",
66+
"https://unpkg.com/prettier@2.6.0/standalone.js",
67+
"https://unpkg.com/prettier@2.6.0/parser-graphql.js",
6868
], (prettier, ...plugins) => {
6969
prettier.format("type Query { hello: String }", {
7070
parser: "graphql",
@@ -89,8 +89,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
8989
### Worker
9090

9191
```js
92-
importScripts("https://unpkg.com/prettier@2.5.1/standalone.js");
93-
importScripts("https://unpkg.com/prettier@2.5.1/parser-graphql.js");
92+
importScripts("https://unpkg.com/prettier@2.6.0/standalone.js");
93+
importScripts("https://unpkg.com/prettier@2.6.0/parser-graphql.js");
9494
prettier.format("type Query { hello: String }", {
9595
parser: "graphql",
9696
plugins: prettierPlugins,
@@ -103,8 +103,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
103103

104104
```html
105105
<script type="module">
106-
import prettier from "https://unpkg.com/prettier@2.5.1/esm/standalone.mjs";
107-
import parserBabel from "https://unpkg.com/prettier@2.5.1/esm/parser-babel.mjs";
106+
import prettier from "https://unpkg.com/prettier@2.6.0/esm/standalone.mjs";
107+
import parserBabel from "https://unpkg.com/prettier@2.6.0/esm/parser-babel.mjs";
108108
109109
console.log(
110110
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -120,9 +120,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
120120

121121
```html
122122
<script type="module">
123-
import prettier from "https://unpkg.com/prettier@2.5.1/esm/standalone.mjs";
124-
import parserBabel from "https://unpkg.com/prettier@2.5.1/esm/parser-babel.mjs";
125-
import parserHtml from "https://unpkg.com/prettier@2.5.1/esm/parser-html.mjs";
123+
import prettier from "https://unpkg.com/prettier@2.6.0/esm/standalone.mjs";
124+
import parserBabel from "https://unpkg.com/prettier@2.6.0/esm/parser-babel.mjs";
125+
import parserHtml from "https://unpkg.com/prettier@2.6.0/esm/parser-html.mjs";
126126
127127
console.log(
128128
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

website/versioned_docs/version-stable/cli.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,7 @@ $ prettier "**/*" --write --ignore-unknown
201201
## `--no-error-on-unmatched-pattern`
202202

203203
Prevent errors when pattern is unmatched.
204+
205+
## `--no-plugin-search`
206+
207+
Disable plugin autoloading.

website/versioned_docs/version-stable/configuration.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,12 @@ You can also switch to the `flow` parser instead of the default `babel` for .js
174174
## Configuration Schema
175175

176176
If you’d like a JSON schema to validate your configuration, one is available here: http://json.schemastore.org/prettierrc.
177+
178+
## EditorConfig
179+
180+
If `options.editorconfig` is `true` and an [`.editorconfig` file](https://editorconfig.org/) is in your project, Prettier will parse it and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by `.prettierrc`, etc. Currently, the following EditorConfig properties are supported:
181+
182+
- `end_of_line`
183+
- `indent_style`
184+
- `indent_size`/`tab_width`
185+
- `max_line_length`

website/versioned_docs/version-stable/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Prettier is an opinionated code formatter with support for:
1414
- [TypeScript](https://www.typescriptlang.org/)
1515
- CSS, [Less](http://lesscss.org/), and [SCSS](https://sass-lang.com)
1616
- [HTML](https://en.wikipedia.org/wiki/HTML)
17+
- [Ember/Handlebars](https://handlebarsjs.com/)
1718
- [JSON](https://json.org/)
1819
- [GraphQL](https://graphql.org/)
1920
- [Markdown](https://commonmark.org/), including [GFM](https://github.github.com/gfm/) and [MDX](https://mdxjs.com/)

website/versioned_docs/version-stable/options.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Specify the line length that the printer will wrap on.
2828
| ------- | --------------------- | ------------------- |
2929
| `80` | `--print-width <int>` | `printWidth: <int>` |
3030

31+
Setting `max_line_length` in an [`.editorconfig` file](https://editorconfig.org/) will configure Prettier’s print width, unless overridden.
32+
3133
(If you don’t want line wrapping when formatting Markdown, you can set the [Prose Wrap](#prose-wrap) option to disable it.)
3234

3335
## Tab Width
@@ -38,6 +40,8 @@ Specify the number of spaces per indentation-level.
3840
| ------- | ------------------- | ----------------- |
3941
| `2` | `--tab-width <int>` | `tabWidth: <int>` |
4042

43+
Setting `indent_size` or `tab_width` in an [`.editorconfig` file](https://editorconfig.org/) will configure Prettier’s tab width, unless overridden.
44+
4145
## Tabs
4246

4347
Indent lines with tabs instead of spaces.
@@ -46,6 +50,8 @@ Indent lines with tabs instead of spaces.
4650
| ------- | ------------ | ----------------- |
4751
| `false` | `--use-tabs` | `useTabs: <bool>` |
4852

53+
Setting `indent_style` in an [`.editorconfig` file](https://editorconfig.org/) will configure Prettier’s tab usage, unless overridden.
54+
4955
(Tabs will be used for _indentation_ but Prettier uses spaces to _align_ things, such as in ternaries.)
5056

5157
## Semicolons
@@ -260,6 +266,7 @@ Valid options:
260266
- `"typescript"` (via [@typescript-eslint/typescript-estree](https://github.com/typescript-eslint/typescript-eslint)) _First available in v1.4.0_
261267
- `"espree"` (via [espree](https://github.com/eslint/espree)) _First available in v2.2.0_
262268
- `"meriyah"` (via [meriyah](https://github.com/meriyah/meriyah)) _First available in v2.2.0_
269+
- `"acorn"` (via [acorn](https://github.com/acornjs/acorn)) _First available in v2.6.0_
263270
- `"css"` (via [postcss-scss](https://github.com/postcss/postcss-scss) and [postcss-less](https://github.com/shellscape/postcss-less), autodetects which to use) _First available in v1.7.1_
264271
- `"scss"` (same parsers as `"css"`, prefers postcss-scss) _First available in v1.7.1_
265272
- `"less"` (same parsers as `"css"`, prefers postcss-less) _First available in v1.7.1_
@@ -383,8 +390,8 @@ Whether or not to indent the code inside `<script>` and `<style>` tags in Vue fi
383390

384391
Valid options:
385392

386-
- `"false"` - Do not indent script and style tags in Vue files.
387-
- `"true"` - Indent script and style tags in Vue files.
393+
- `false` - Do not indent script and style tags in Vue files.
394+
- `true` - Indent script and style tags in Vue files.
388395

389396
| Default | CLI Override | API Override |
390397
| ------- | ------------------------------- | --------------------------------- |
@@ -426,6 +433,8 @@ Valid options:
426433
| ------- | ----------------------------------------------------------- | ---------------------------------------------------------- |
427434
| `"lf"` | <code>--end-of-line <lf&#124;crlf&#124;cr&#124;auto></code> | <code>endOfLine: "<lf&#124;crlf&#124;cr&#124;auto>"</code> |
428435

436+
Setting `end_of_line` in an [`.editorconfig` file](https://editorconfig.org/) will configure Prettier’s end of line usage, unless overridden.
437+
429438
## Embedded Language Formatting
430439

431440
_First available in v2.1.0_
@@ -444,3 +453,18 @@ Valid options:
444453
| Default | CLI Override | API Override |
445454
| -------- | ------------------------------------ | ----------------------------------- |
446455
| `"auto"` | `--embedded-language-formatting=off` | `embeddedLanguageFormatting: "off"` |
456+
457+
## Single Attribute Per Line
458+
459+
_First available in v2.6.0_
460+
461+
Enforce single attribute per line in HTML, Vue and JSX.
462+
463+
Valid options:
464+
465+
- `false` - Do not enforce single attribute per line.
466+
- `true` - Enforce single attribute per line.
467+
468+
| Default | CLI Override | API Override |
469+
| ------- | ----------------------------- | -------------------------------- |
470+
| `false` | `--single-attribute-per-line` | `singleAttributePerLine: <bool>` |

0 commit comments

Comments
 (0)