microsoft / vscode-wordcount

Sample Word Count extension for VS Code.
Other
124 stars 80 forks source link

"Property '_statusBarItem' has no initializer" error. #16

Closed reyou closed 6 years ago

reyou commented 6 years ago

I am following documentation below; https://code.visualstudio.com/docs/extensions/example-word-count#_update-the-status-bar

If I use code snippet at the page, or here I am getting following error:

message: 'Property '_statusBarItem' has no initializer and is not definitely assigned in the constructor.'

VS Code configured to use TypeScript 2.7.2.

Am I missing something here?

Error SS:

image

gregvanl commented 6 years ago

Thanks for calling this out. This is due to TypeScript 2.7+ setting --strictPropertyInitialization on by default. Fixed in the VS Code documentation with https://github.com/Microsoft/vscode-docs/commit/06f622eddc4156db015d6375d2c372305383189d.

reyou commented 6 years ago

Thanks a lot!