Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new js proposals: optional-chaining & pipeline-operator #1530

Closed
sfger opened this issue Sep 4, 2018 · 5 comments · Fixed by #1780
Closed

Support new js proposals: optional-chaining & pipeline-operator #1530

sfger opened this issue Sep 4, 2018 · 5 comments · Fixed by #1780

Comments

@sfger
Copy link

sfger commented Sep 4, 2018

Description

NOTE:

  • Check the list of open issues before filing a new issue.
  • Please update the expect output section to match how you would prefer the code to look.

Input

The code looked like this before beautification:

'test' |> console.log;
let a = {};
a?.b?.c?.d;

Current Output

The code actually looked like this after beautification:

'test' | > console.log;
let a = {};
a ? .b ? .c ? .d;

Expected Output

The code should have looked like this after beautification:

/*Adjust the code to look how you prefer the output to be.*/
'test' |> console.log;
let a = {};
a?.b?.c?.d;

Environment

Browser User Agent:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Language Selected:
JavaScript

Settings

Example:

{
  "indent_size": "4",
  "indent_char": " ",
  "max_preserve_newlines": "5",
  "preserve_newlines": true,
  "keep_array_indentation": false,
  "break_chained_methods": false,
  "indent_scripts": "normal",
  "brace_style": "collapse",
  "space_before_conditional": true,
  "unescape_strings": false,
  "jslint_happy": false,
  "end_with_newline": false,
  "wrap_line_length": "0",
  "indent_inner_html": false,
  "comma_first": false,
  "e4x": false
}
@sfger sfger changed the title Can we support the new js proposals: optional-chaining & pipeline-operator Support new js proposals: optional-chaining & pipeline-operator Sep 4, 2018
@bitwiseman
Copy link
Member

bitwiseman commented Sep 4, 2018

@sfger
https://github.com/tc39/proposal-pipeline-operator Says that there are competing proposals for pipeline operator.

https://github.com/tc39/proposal-optional-chaining is further along.

Both would be relatively easy to add the list of operators. PR's with tests welcome.

@theblang
Copy link

theblang commented Jun 28, 2019

@bitwiseman Looks like proposal-optional-chaining has made it to stage 2!

@bitwiseman
Copy link
Member

@theblang
Thanks! If you have time to submit a PR with tests that would be great!

@theblang
Copy link

@sfger @bitwiseman I'm thinking that this issue should change to become "optional-chaining & nullish-coalescing". Both optional-chaining and nullish-coalescing are now at stage 3! But pipeline-operator is still at stage 1.

@bitwiseman
Copy link
Member

@theblang Yes, each item should be filed as separate issue that can be tracked to completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants