Functions as parameters do not indent correctly (fixed by current Prettier)
schallm opened this issue · 2 comments
schallm commented
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
- 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.
jesperbjensen commented
This should be fixed by the newest CI version. I will close the issue when a new version is published to the public gallery
jesperbjensen commented
Fixed in recent release: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.JavaScriptPrettier