Skip to content

Commit d6f82a0

Browse files
committed
Release 2.6.2
1 parent 2bca9d6 commit d6f82a0

File tree

8 files changed

+87
-38
lines changed

8 files changed

+87
-38
lines changed

.github/ISSUE_TEMPLATE/formatting.md

+1-1
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.6.1**
29+
**Prettier 2.6.2**
3030
[Playground link](https://prettier.io/playground/#.....)
3131

3232
```sh

.github/ISSUE_TEMPLATE/integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
2020

2121
**Environments:**
2222

23-
- Prettier Version: 2.6.1
23+
- Prettier Version: 2.6.2
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

+58
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,61 @@
1+
# 2.6.2
2+
3+
[diff](https://github.com/prettier/prettier/compare/2.6.1...2.6.2)
4+
5+
#### Fix LESS/SCSS format error ([#12536](https://github.com/prettier/prettier/pull/12536) by [@fisker](https://github.com/fisker))
6+
7+
<!-- prettier-ignore -->
8+
```less
9+
// Input
10+
.background-gradient(@cut) {
11+
background: linear-gradient(
12+
to right,
13+
@white 0%,
14+
@white (@cut - 0.01%),
15+
@portal-background @cut,
16+
@portal-background 100%
17+
);
18+
}
19+
20+
// Prettier 2.6.1
21+
TypeError: Cannot read properties of undefined (reading 'endOffset')
22+
23+
// Prettier 2.6.2
24+
.background-gradient(@cut) {
25+
background: linear-gradient(
26+
to right,
27+
@white 0%,
28+
@white (@cut - 0.01%),
29+
@portal-background @cut,
30+
@portal-background 100%
31+
);
32+
}
33+
```
34+
35+
#### Update `meriyah` to fix several bugs ([#12567](https://github.com/prettier/prettier/pull/12567) by [@fisker](https://github.com/fisker), fixes in [`meriyah`](https://github.com/meriyah/meriyah/) by [@3cp](https://github.com/3cp))
36+
37+
Fixes bugs when parsing following valid code:
38+
39+
```js
40+
foo(await bar());
41+
```
42+
43+
```js
44+
const regex = /.*/ms;
45+
```
46+
47+
```js
48+
const element = <p>{/w/.test(s)}</p>;
49+
```
50+
51+
```js
52+
class A extends B {
53+
#privateMethod() {
54+
super.method();
55+
}
56+
}
57+
```
58+
159
# 2.6.1
260

361
[diff](https://github.com/prettier/prettier/compare/2.6.0...2.6.1)

docs/browser.md

+13-13
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/[email protected].1/standalone.js"></script>
36-
<script src="https://unpkg.com/[email protected].1/parser-graphql.js"></script>
35+
<script src="https://unpkg.com/[email protected].2/standalone.js"></script>
36+
<script src="https://unpkg.com/[email protected].2/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/[email protected].1/esm/standalone.mjs";
52-
import parserGraphql from "https://unpkg.com/[email protected].1/esm/parser-graphql.mjs";
51+
import prettier from "https://unpkg.com/[email protected].2/esm/standalone.mjs";
52+
import parserGraphql from "https://unpkg.com/[email protected].2/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/[email protected].1/standalone.js",
66-
"https://unpkg.com/[email protected].1/parser-graphql.js",
65+
"https://unpkg.com/[email protected].2/standalone.js",
66+
"https://unpkg.com/[email protected].2/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/[email protected].1/standalone.js");
92-
importScripts("https://unpkg.com/[email protected].1/parser-graphql.js");
91+
importScripts("https://unpkg.com/[email protected].2/standalone.js");
92+
importScripts("https://unpkg.com/[email protected].2/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/[email protected].1/esm/standalone.mjs";
106-
import parserBabel from "https://unpkg.com/[email protected].1/esm/parser-babel.mjs";
105+
import prettier from "https://unpkg.com/[email protected].2/esm/standalone.mjs";
106+
import parserBabel from "https://unpkg.com/[email protected].2/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/[email protected].1/esm/standalone.mjs";
123-
import parserBabel from "https://unpkg.com/[email protected].1/esm/parser-babel.mjs";
124-
import parserHtml from "https://unpkg.com/[email protected].1/esm/parser-html.mjs";
122+
import prettier from "https://unpkg.com/[email protected].2/esm/standalone.mjs";
123+
import parserBabel from "https://unpkg.com/[email protected].2/esm/parser-babel.mjs";
124+
import parserHtml from "https://unpkg.com/[email protected].2/esm/parser-html.mjs";
125125
126126
console.log(
127127
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

package.json

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

website/versioned_docs/version-stable/browser.md

+13-13
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/[email protected].1/standalone.js"></script>
37-
<script src="https://unpkg.com/[email protected].1/parser-graphql.js"></script>
36+
<script src="https://unpkg.com/[email protected].2/standalone.js"></script>
37+
<script src="https://unpkg.com/[email protected].2/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/[email protected].1/esm/standalone.mjs";
53-
import parserGraphql from "https://unpkg.com/[email protected].1/esm/parser-graphql.mjs";
52+
import prettier from "https://unpkg.com/[email protected].2/esm/standalone.mjs";
53+
import parserGraphql from "https://unpkg.com/[email protected].2/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/[email protected].1/standalone.js",
67-
"https://unpkg.com/[email protected].1/parser-graphql.js",
66+
"https://unpkg.com/[email protected].2/standalone.js",
67+
"https://unpkg.com/[email protected].2/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/[email protected].1/standalone.js");
93-
importScripts("https://unpkg.com/[email protected].1/parser-graphql.js");
92+
importScripts("https://unpkg.com/[email protected].2/standalone.js");
93+
importScripts("https://unpkg.com/[email protected].2/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/[email protected].1/esm/standalone.mjs";
107-
import parserBabel from "https://unpkg.com/[email protected].1/esm/parser-babel.mjs";
106+
import prettier from "https://unpkg.com/[email protected].2/esm/standalone.mjs";
107+
import parserBabel from "https://unpkg.com/[email protected].2/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/[email protected].1/esm/standalone.mjs";
124-
import parserBabel from "https://unpkg.com/[email protected].1/esm/parser-babel.mjs";
125-
import parserHtml from "https://unpkg.com/[email protected].1/esm/parser-html.mjs";
123+
import prettier from "https://unpkg.com/[email protected].2/esm/standalone.mjs";
124+
import parserBabel from "https://unpkg.com/[email protected].2/esm/parser-babel.mjs";
125+
import parserHtml from "https://unpkg.com/[email protected].2/esm/parser-html.mjs";
126126
127127
console.log(
128128
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

website/versioned_docs/version-stable/integrating-with-linters.md

-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Linters usually contain not only code quality rules, but also stylistic rules. M
99
Luckily it’s easy to turn off rules that conflict or are unnecessary with Prettier, by using these pre-made configs:
1010

1111
- [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier)
12-
- [tslint-config-prettier](https://github.com/alexjoverm/tslint-config-prettier)
1312
- [stylelint-config-prettier](https://github.com/prettier/stylelint-config-prettier)
1413

1514
Check out the above links for instructions on how to install and set things up.
@@ -21,7 +20,6 @@ When searching for both Prettier and your linter on the Internet you’ll probab
2120
First, we have plugins that let you run Prettier as if it was a linter rule:
2221

2322
- [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
24-
- [tslint-plugin-prettier](https://github.com/ikatyang/tslint-plugin-prettier)
2523
- [stylelint-prettier](https://github.com/prettier/stylelint-prettier)
2624

2725
These plugins were especially useful when Prettier was new. By running Prettier inside your linters, you didn’t have to set up any new infrastructure and you could re-use your editor integrations for the linters. But these days you can run `prettier --check .` and most editors have Prettier support.
@@ -35,7 +33,6 @@ The downsides of those plugins are:
3533
Finally, we have tools that run `prettier` and then immediately for example `eslint --fix` on files.
3634

3735
- [prettier-eslint](https://github.com/prettier/prettier-eslint)
38-
- [prettier-tslint](https://github.com/azz/prettier-tslint)
3936
- [prettier-stylelint](https://github.com/hugomrdias/prettier-stylelint)
4037

4138
Those are useful if some aspect of Prettier’s output makes Prettier completely unusable to you. Then you can have for example `eslint --fix` fix that up for you. The downside is that these tools are much slower than just running Prettier.

website/versioned_docs/version-stable/related-projects.md

-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ original_id: related-projects
1717
- [stylelint-prettier](https://github.com/prettier/stylelint-prettier) runs Prettier as a stylelint rule and reports differences as individual stylelint issues
1818
- [prettier-stylelint](https://github.com/hugomrdias/prettier-stylelint) passes `prettier` output to `stylelint --fix`
1919

20-
## TSLint Integrations
21-
22-
- [tslint-config-prettier](https://github.com/alexjoverm/tslint-config-prettier) use TSLint with Prettier without any conflict
23-
- [tslint-plugin-prettier](https://github.com/ikatyang/tslint-plugin-prettier) runs Prettier as a TSLint rule and reports differences as individual TSLint issues
24-
- [prettier-tslint](https://github.com/azz/prettier-tslint) passes `prettier` output to `tslint --fix`
25-
2620
## Forks
2721

2822
- [prettierx](https://github.com/brodybits/prettierx) less opinionated fork of Prettier

0 commit comments

Comments
 (0)