edjm
edjm

Reputation: 5472

Which comment format is correct for TypeScript with annotations?

I've been searching for an example of commenting on code that is annotated, all I can find are examples of comments on non annotated code. Can anyone clarify the correct or approved standard way of writing this?

/**
 * Description.
 */
@Component({...})
class MyClass{...}

Or would this be written as

@Component({...})
/**
 * Description.
 */
class MyClass{...}

Upvotes: 2

Views: 1037

Answers (1)

Kewin Dousse
Kewin Dousse

Reputation: 4027

CompoDoc has an example of them using the first variation of the syntax you described. So, that means this (quoting their example) :

/**
 * @ignore
 */
@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
})
export class AppComponent {}

However as shows this issue, there's currently no fixed or official specification on how to write your TSDoc.

Upvotes: 1

Related Questions