question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
theblangcommented, Jun 28, 2019

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

0reactions
bitwisemancommented, Jul 26, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/plugin-proposal-optional-chaining
NOTE**: This plugin is included in `@babel/preset-env`, in [ES2020](https://github.com/tc39/proposals/blob/master/finished-proposals.md)
Read more >
JavaScript Proposal: Optional Chaining | by Denny Scott
Optional chaining isn't the flashiest new proposal, but it represents a significant quality of life improvement for Javascript developers.
Read more >
How to use the @babel/plugin-proposal-pipeline ... - Snyk
To help you get started, we've selected a few @babel/plugin-proposal-pipeline-operator examples, based on popular ways it is used in public projects.
Read more >
ESNext: JavaScript “Optional Chaining Operator” - Bram.us
UPDATE: The proposed operator got renamed from “Null Propagation Operator” to “Optional Chaining Operator”. This post has been updated to ...
Read more >
Ben Lesh on Twitter: "IMO, the #JavaScript pipeline operator is ...
Optional chaining is cute sugar to help you type less. Pipeline creates all new ways to create declarative, functional code that's very readable ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found