Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support hack-style pipeline (#11335)
* Avoid to conflicts to v8intrinsic plugin * Support hack-style pipeline * Update tests for hask-style pipeline * Update tests 2 * Add changelog * Update misc tests * Address reviews * Fix type error * Copy plugin array * Add tests * Address review * Add error tests
- Loading branch information
1 parent
83e5ebe
commit 53f95f3
Showing
16 changed files
with
382 additions
and
330 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,20 @@ | ||
#### Support hack-style pipeline proposal (#11335 by @sosukesuzuki) | ||
|
||
Support new [hack-style pipeline proposal](https://github.com/js-choi/proposal-hack-pipes). We chose `%` as the topic token, following the official explainer. | ||
|
||
Also, [smart-style pipeline proposal](https://github.com/js-choi/proposal-smart-pipelines) is removed. See https://prettier.io/docs/en/rationale.html#disclaimer-about-non-standard-syntax for the rationale behind this decision. | ||
|
||
```js | ||
// Input | ||
const foo = fn() |> fn1(%) |> fn2(%); | ||
|
||
// Prettier stable | ||
SyntaxError: Unexpected token (1:25) | ||
> 1 | const foo = fn() |> fn1(%) |> fn2(%); | ||
| ^ | ||
2 | | ||
|
||
// Prettier main | ||
const foo = fn() |> fn1(%) |> fn(%); | ||
|
||
``` |
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
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,8 @@ | ||
// https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator | ||
// https://github.com/js-choi/proposal-hack-pipes | ||
|
||
return list | ||
|> take(prefix.length, %) | ||
|> equals(%, prefix); | ||
|
||
// (The % token isn't final; it might instead be @ or ? or #.) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.