madskristensen/JavaScriptPrettier

Functions as parameters do not indent correctly (fixed by current Prettier)

schallm opened this issue · 2 comments

Installed product versions

  • Visual Studio: 2017 Enterprise
  • This extension: 1.1.21

Description

Formatting function calls with functions as parameters does not indent correctly. The current version of prettier seems to resolve this issue.

Steps to recreate

  1. Formatting following code
            request
                .get("/api/session", {
                    headers: { "Content-Type": "application/json" },
                    handleAs: "json"
                })
                .then(
                function () {
                    alert("success");
                },
                function (err) {
                    alert("failure");
                }
                );

Current behavior

Notice the success and error functions passed to the then function are at the same indentation as the .then line.

Expected behavior

This seems to be fixed with the current version 1.7.4 as the playground (https://prettier.io/playground/) formats it correctly.

This should be fixed by the newest CI version. I will close the issue when a new version is published to the public gallery