-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
Motivation
Place JSDoc in the proper location relative to decorators/annotations.
TypeScript projects frequently use decorators for classes and functions and the autofix for jsdoc/require-jsdoc places JSDoc in the wrong place.
Current behavior
Currently, the eslint fixer for the rule jsdoc/require-jsdoc places an auto-generated JSDoc in between the declaration/definition and decorator instead above the decorator like so:
@Entity('users')
/**
*
*/
export class User {}See the live example here.
Desired behavior
The fixer should place the auto-generated JSDoc above the decorator like so by default:
/**
*
*/
@Entity('users')
export class User {}Decorators are part of the definition/declaration so that's why comments should go above them.
Alternatives considered
Location of a JSDoc relative to a decorator could be made into a setting that either places the JSDoc above or below decorators.