madskristensen / JavaScriptPrettier

A Visual Studio extension
Other
157 stars 30 forks source link

Knockout observable properties are formatted wrong #8

Closed nwinger closed 6 years ago

nwinger commented 7 years ago

Installed product versions

Description

Formatting of model properties of type ko.observable are formatted wrong, causing code errors.

Steps to recreate

Create a class containing a knockout based boolean property

Current behavior

closeButtonVisible = ko.observable < boolean > false; Causing the following code to be invalid: vm.closeButtonVisible(true);

Cannot invoke an expression whose type lacks a call signature. Type 'Boolean' has no compatible call signatures-

Expected behavior

closeButtonVisible = ko.observable<boolean>(false);

madskristensen commented 7 years ago

Can you please open the issue on the Prettier repo, since this extension just calls it https://github.com/prettier/prettier

nwinger commented 7 years ago

@madskristensen Tried it in VSCode with the latest version just for kicks. Not the same behaviour. Do you depend on different versions?

jesperbjensen commented 6 years ago

Hi @nwinger

The newest CI build updates Prettier to the latest version. It should fix the issue. I will close the issue when a new version is published to the public gallery

jesperbjensen commented 6 years ago

Fixed in recent release: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.JavaScriptPrettier