madskristensen/JavaScriptPrettier

Knockout observable properties are formatted wrong

nwinger opened this issue · 4 comments

Installed product versions

  • Visual Studio: 2017 Enterprise
  • JavaScript Prettier 1.1.21

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);

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

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

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