Support JSDoc `@property`
See original GitHub issueFrom @BrunnerLivio on May 8, 2017 9:1
- VSCode Version: 1.12.1
- OS Version: Ubuntu 16.04.1 LTS (Xenial Xerus)
Example code: MyController.js
// @ts-check
class MyController {
getWorld() {
return this.world; // <--- Marked as error
}
}
angular
.module('myApp')
.component('myComponent', {
bindings: {
'world': '<'
},
controller: MyController,
template: `<div>Hello {{$ctrl.getWorld()}}</div>`
});
The this.world
is marked as error, as supposed to be. But it is actually pretty annoying, because in angular you need to use quite often those component bindings. I know there’s the option // @ts-ignore
, but that really pollutes the code and makes it less readable.
An extensions for this would be really useful.
I use this workaround at the moment
// @ts-check
class MyController {
constructor() {
this.world = this.world;
}
getWorld() {
return this.world;
}
}
[...]
I don’t like this at all, but better than writing // @ts-ignore
.
Is there any other option / workaround?
Copied from original issue: Microsoft/vscode#26192
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Use JSDoc: @property
The @property tag is a way to easily document a list of static properties of a class, namespace or other object. Normally JSDoc...
Read more >JSDoc Reference - TypeScript: Documentation
JSDoc Reference. The list below outlines which constructs are currently supported when using JSDoc annotations to provide type information in JavaScript files.
Read more >jsdoc @property does not support default values
When writing a javascript jsdoc comment, if you specify a default value for a property it's not shown in intellisense. Example:
Read more >JsDoc support
@property and @member — used to describe properties as part of a @typedef type declaration. See above for an example. Type Syntax. Visual...
Read more >jsDoc | Add support for optional properties in @typedef with ...
jsDoc | Add support for optional properties in @typedef with @property. 2. I have next code. /** * @typedef {object} MyType * @property...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@property
would be the best way to go i would say.alright, I’d duplicate my case here:
The example above currently doesn’t work, since it “does not see” child methods.
it’s not only about
@property
, but about supporting jsdocnamepath
as well. http://usejsdoc.org/about-namepaths.htmlThanks for creating a great product.
Regards,