Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaScript: Fix pipeline bugs (#7979)
* Fix arrow regression * Fix resolvePluginConflict * Update changelog * Fix condition * Edit changelog: add link to Babel blog, change order (to be as in the blog) Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
- Loading branch information
1 parent
f675922
commit 17d6e38
Showing
5 changed files
with
37 additions
and
33 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 |
---|---|---|
@@ -1,36 +1,37 @@ | ||
#### Support the 'smart' and 'fsharp-style' pipeline operator proposal ([#6319](https://github.com/prettier/prettier/pull/6319) by [@sosukesuzuki](https://github.com/sosukesuzuki), [@thorn0](https://github.com/thorn0)) | ||
#### Support the F# and Smart pipeline operator proposals ([#6319](https://github.com/prettier/prettier/pull/6319) by [@sosukesuzuki](https://github.com/sosukesuzuki), [@thorn0](https://github.com/thorn0), [#7979](https://github.com/prettier/prettier/pull/7979) by [@sosukesuzuki](https://github.com/sosukesuzuki)) | ||
|
||
- [Link to the 'smart' pipeline proposal](https://github.com/js-choi/proposal-smart-pipelines) | ||
- [Link to the 'fsharp-style' pipeline proposal](https://github.com/valtech-nyc/proposal-fsharp-pipelines) | ||
- [F# Pipeline Operator proposal](https://github.com/valtech-nyc/proposal-fsharp-pipelines) | ||
- [Smart Pipelines proposal](https://github.com/js-choi/proposal-smart-pipelines) | ||
- [Babel Blog: What's Happening With the Pipeline (`|>`) Proposal?](https://babeljs.io/blog/2018/07/19/whats-happening-with-the-pipeline-proposal) | ||
|
||
**Smart Pipeline:** | ||
**F#-style Pipeline:** | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Input | ||
5 |> # * 2 | ||
promises |> await; | ||
|
||
// Output (Prettier Stable) | ||
SyntaxError: Unexpected character '#' (1:6) | ||
> 1 | 5 |> # * 2 | ||
| ^ | ||
// Output (Prettier stable) | ||
SyntaxError: Unexpected token (1:18) | ||
> 1 | promises |> await; | ||
| ^ | ||
|
||
// Output (Prettier master) | ||
5 |> # * 2 | ||
promises |> await; | ||
``` | ||
|
||
**F#-style Pipeline:** | ||
**Smart Pipeline:** | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Input | ||
promises |> await; | ||
5 |> # * 2 | ||
|
||
// Output (Prettier stable) | ||
SyntaxError: Unexpected token (1:18) | ||
> 1 | promises |> await; | ||
| ^ | ||
// Output (Prettier Stable) | ||
SyntaxError: Unexpected character '#' (1:6) | ||
> 1 | 5 |> # * 2 | ||
| ^ | ||
|
||
// Output (Prettier master) | ||
promises |> await; | ||
5 |> # * 2 | ||
``` |
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
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 |
---|---|---|
|
@@ -11,3 +11,6 @@ function f() { | |
} | ||
) | ||
} | ||
|
||
((x) => x) + ''; | ||
'' + ((x) => x); |