Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:prettier/prettier into svgo
* 'master' of github.com:prettier/prettier: (51 commits) Bump @typescript-eslint/typescript-estree from 2.8.0 to 2.9.0 (#7054) Bump @babel/preset-react from 7.7.0 to 7.7.4 in /website (#7044) Bump @babel/preset-env from 7.7.1 to 7.7.4 in /website (#7045) Bump rollup from 1.27.3 to 1.27.5 (#7047) Bump @babel/parser from 7.7.3 to 7.7.4 (#7034) Bump @babel/preset-env from 7.7.1 to 7.7.4 (#7035) Bump resolve from 1.12.0 to 1.12.2 (#7032) fix formatting of logical and binary expressions in template literals (#7010) Bump docusaurus from 1.14.1 to 1.14.2 in /website (#7030) fix unstable formatting of logical expressions (#7026) Bump rollup from 1.27.2 to 1.27.3 (#7025) TypeScript: print JSDoc-only types (#7020) Bump docusaurus from 1.14.0 to 1.14.1 in /website (#7023) preserve parentheses for JSDoc type casting with extra spaces a… (#7011) Bump rollup from 1.26.3 to 1.27.2 (#7016) Ignore test files (#7018) Bump @typescript-eslint/typescript-estree from 2.7.0 to 2.8.0 (#7017) refactoring: tokens requested from TS parser were immediately dismissed (#7008) test: css-in-js (#7005) tests(handlebars): Move a test to handlebars folder (#6962) ...
- Loading branch information
Showing
85 changed files
with
5,863 additions
and
1,560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Security Policy | ||
|
||
## Reporting a Vulnerability | ||
|
||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#### Don't lowercase element names in CSS selectors ([#6947](https://github.com/prettier/prettier/pull/6947) by [@ark120202](https://github.com/ark120202)) | ||
|
||
Previously, Prettier already preserved casing of unknown element names, but it did lowercase names of HTML elements. | ||
This caused issues when CSS was applied to a case-sensitive document and an there was an element with the same name as in HTML, which is the case in NativeScript. | ||
Prettier now always preserves original casing. | ||
|
||
<!-- prettier-ignore --> | ||
```css | ||
/* Input */ | ||
Label { | ||
} | ||
|
||
/* Prettier stable */ | ||
label { | ||
} | ||
|
||
/* Prettier master */ | ||
Label { | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#### Fix formatting of labeled statements with comments ([#6994](https://github.com/prettier/prettier/pull/6984) by [@clement26695](https://github.com/clement26695)) | ||
|
||
Formatting of comments in labeled statements was not stable | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
loop1: | ||
//test | ||
const i = 3; | ||
|
||
// Prettier stable (first output) | ||
loop1: //test | ||
const i = 3; | ||
|
||
// Prettier stable (second output) | ||
//test | ||
loop1: const i = 3; | ||
|
||
// Prettier master (first output) | ||
//test | ||
loop1: const i = 3; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#### Fix formatting of logical, binary and sequence expressions in template literals ([#7010](https://github.com/prettier/prettier/pull/7010) by [@evilebottnawi](https://github.com/evilebottnawi)) | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Input | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${foo || bar}`; | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${foo | bar}`; | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${(foo, bar)}`; | ||
|
||
// Prettier stable | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${foo || | ||
bar}`; | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${foo | | ||
bar}`; | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${(foo, | ||
bar)}`; | ||
|
||
// Prettier master | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${ | ||
foo || bar | ||
}`; | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${ | ||
foo | bar | ||
}`; | ||
`111111111 222222222 333333333 444444444 555555555 666666666 777777777 ${ | ||
(foo, bar) | ||
}`; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#### Preserve parentheses for JSDoc type casting with extra spaces and asterisk at end ([#7011](https://github.com/prettier/prettier/pull/7011) by [@evilebottnawi](https://github.com/evilebottnawi)) | ||
|
||
Formatting of comments in labeled statements was not stable | ||
|
||
<!-- prettier-ignore --> | ||
```javascript | ||
// Input | ||
const foo = /** @type {!Foo} **/ (baz); | ||
const bar = /** @type {!Foo} * * */(baz); | ||
|
||
// Prettier stable | ||
const foo = /** @type {!Foo} **/ baz; | ||
const bar = /** @type {!Foo} * * */ baz; | ||
|
||
// Prettier master | ||
const foo = /** @type {!Foo} **/ (baz); | ||
const bar = /** @type {!Foo} * * */ (baz); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#### Fix unstable formatting of logical expressions ([#7026](https://github.com/prettier/prettier/pull/7026) by [@thorn0](https://github.com/thorn0)) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
const averredBathersBoxroomBuggyNurl = | ||
bifornCringerMoshedPerplexSawder === 1 || | ||
(askTrovenaBeenaDependsRowans === 2 || glimseGlyphsHazardNoopsTieTie === 3); | ||
|
||
// Prettier stable (first output) | ||
const averredBathersBoxroomBuggyNurl = | ||
bifornCringerMoshedPerplexSawder === 1 || | ||
askTrovenaBeenaDependsRowans === 2 || glimseGlyphsHazardNoopsTieTie === 3; | ||
|
||
// Prettier stable (second output) | ||
const averredBathersBoxroomBuggyNurl = | ||
bifornCringerMoshedPerplexSawder === 1 || | ||
askTrovenaBeenaDependsRowans === 2 || | ||
glimseGlyphsHazardNoopsTieTie === 3; | ||
|
||
// Prettier master (first output) | ||
const averredBathersBoxroomBuggyNurl = | ||
bifornCringerMoshedPerplexSawder === 1 || | ||
askTrovenaBeenaDependsRowans === 2 || | ||
glimseGlyphsHazardNoopsTieTie === 3; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#### Handle zero-based lists correctly ([#6852](https://github.com/prettier/prettier/pull/6852) by [@evilebottnawi](https://github.com/evilebottnawi)) | ||
|
||
<!-- prettier-ignore --> | ||
```md | ||
<!-- Input --> | ||
0. List | ||
1. List | ||
2. List | ||
|
||
<!-- Prettier stable --> | ||
0. List | ||
1. List | ||
1. List | ||
|
||
<!-- Prettier master --> | ||
0. List | ||
1. List | ||
2. List | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#### MDX: fix JSX Fragment format incorrectly ([#6398](https://github.com/prettier/prettier/pull/6398) by [@JounQin](https://github.com/JounQin)) | ||
|
||
Previous versions format JSX Fragment incorrectly in mdx, this has been fixed in this version. | ||
|
||
<!-- prettier-ignore --> | ||
```md | ||
<!-- Input --> | ||
<> | ||
test <World /> test | ||
</> 123 | ||
|
||
<!-- Output (Prettier stable) --> | ||
<> | ||
test <World /> test | ||
</> 123 | ||
|
||
<!-- Output (Prettier master) --> | ||
<> | ||
test <World /> test | ||
</> 123 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#### Fix MDX html parsing errors ([#6949](https://github.com/prettier/prettier/pull/6949) by [@Tigge](https://github.com/Tigge) & [@thorn0](https://github.com/thorn0)) | ||
|
||
MDX parsing for JSX failed when encountering JSX elements that where not | ||
parsable as HTML. Such as `<Tag value={{a: 'b'}}>test</Tag>` | ||
|
||
<!-- prettier-ignore --> | ||
````md | ||
<!-- Input --> | ||
|
||
<Tag value={ {a : 'b' } }>test</ Tag> | ||
|
||
<Foo bg={ 'red' } > | ||
<div style={{ display: 'block'} }> | ||
<Bar >hi </Bar> | ||
{ hello } | ||
{ /* another comment */} | ||
</div> | ||
</Foo> | ||
|
||
<!-- Prettier stable --> | ||
|
||
``` | ||
SyntaxError: Unexpected closing tag "Tag". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (1:35) | ||
> 1 | <Tag value={ {a : 'b' } }>test</ Tag> | ||
| ^ | ||
2 | | ||
3 | <Foo bg={ 'red' } > | ||
4 | <div style={{ display: 'block'} }> | ||
``` | ||
|
||
<!-- Prettier master --> | ||
|
||
<Tag value={{ a: "b" }}>test</Tag> | ||
|
||
<Foo bg={"red"}> | ||
<div style={{ display: "block" }}> | ||
<Bar>hi </Bar> | ||
{hello} | ||
{/* another comment */} | ||
</div> | ||
</Foo> | ||
|
||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#### Don't add extra comma after last comment in map ([#6918](https://github.com/prettier/prettier/pull/6918) by [@fisker](https://github.com/fisker)) | ||
|
||
Previously, when `trailingComma` set to `es5`, extra comma added after last comment in map. | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
// Input | ||
$my-map: ( | ||
'foo': 1, // Comment | ||
'bar': 2, // Comment | ||
); | ||
|
||
// Prettier stable | ||
$my-map: ( | ||
"foo": 1, | ||
// Comment | ||
"bar": 2, | ||
// Comment, | ||
); | ||
|
||
// Prettier master | ||
$my-map: ( | ||
"foo": 1, | ||
// Comment | ||
"bar": 2, | ||
// Comment | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#### Fix formatting of type operator as arrow function return type ([#6901](https://github.com/prettier/prettier/pull/6901) by [@sosukesuzuki](https://github.com/sosukesuzuki)) | ||
|
||
<!-- prettier-ignore --> | ||
```ts | ||
// Input | ||
export const getVehicleDescriptor = async ( | ||
vehicleId: string | ||
): Promise< | ||
Collections.Parts.PrintedCircuitBoardAssembly["attributes"] & undefined | ||
> => {}; | ||
|
||
// Prettier stable | ||
export const getVehicleDescriptor = async ( | ||
vehicleId: string | ||
): Promise<Collections.Parts.PrintedCircuitBoardAssembly["attributes"] & | ||
undefined> => {}; | ||
|
||
// Prettier master | ||
export const getVehicleDescriptor = async ( | ||
vehicleId: string | ||
): Promise< | ||
Collections.Parts.PrintedCircuitBoardAssembly["attributes"] & undefined | ||
> => {}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#### Print JSDoc-only types as is instead of throwing strange errors ([#7020](https://github.com/prettier/prettier/pull/7020) by [@thorn0](https://github.com/thorn0)) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
function fromFlow(arg: ?Maybe) {} | ||
|
||
// Prettier stable | ||
Error: unknown type: "TSJSDocNullableType" | ||
at printPathNoParens (https://prettier.io/lib/standalone.js:26012:13) | ||
at Object.genericPrint$3 [as print] (https://prettier.io/lib/standalone.js:23541:28) | ||
|
||
// Prettier master | ||
function fromFlow(arg: ?Maybe) {} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,6 +348,7 @@ | |
"Transloadit", | ||
"TSAs", | ||
"tsep", | ||
"TSJS", | ||
"Typeahead", | ||
"typecasted", | ||
"typeof", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.