tslint error: Asterik in jsdoc must be aligned

2019-07-17 16:14发布

I keep getting this tslint error and don't see what's wrong with the code. Does anybody see an issues with the jsdoc asteriks below not being aligned correctly:

/**
 * @ngdoc directive
 * @module ers.components.button
 * @scope
 * @transclude
 * @data
 * @binding
 * @name ersButton
 * @restrict E
 * @constructor
 * 
 * @description
 * 
 * A button performs the defined action when the user clicks it.
 * 
 * - Buttons can only consist of text and/or an icon.
 * - Buttons must contain either a click event, an href, an ui-sref, or a type (for form actions).
 * - Buttons labels should be clear. Limit the button text (less is more).
 * 
 * ### Usage
 * 
 * - Use <b>Primary Buttons</b> for primary actions (for example, "Submit", "Login", or "Save"). 
 * Avoid having multiple primary buttons on the same screen.
 * - Use <b>Secondary Buttons</b> for secondary actions that accompany the primary call-to-action (for example, "Reset" or "Cancel").
 * - Use <b>Icon Buttons</b> only for special use cases where standard label buttons are too large to use (for example, Tool Bars).
 *   
 * ### Examples
 * 
 * #### Standard Buttons
 * 
 * Primary and secondary buttons.
 *
 * <code-editor identifier="example1" data-title="Basic Buttons" html-content-url="demos/ersButton/basic/index.html" 
 * js-content-url="demos/ersButton/basic/script.js" css-content-url="demos/ersButton/basic/styles.css" 
 * content-mode="html"></code-editor>
 */

Just about every line below is giving me that same error.

1条回答
老娘就宠你
2楼-- · 2019-07-17 16:56

From jsdoc-format rule description:

The following rules are enforced for JSDoc comments (comments starting with /**):

  • each line contains an asterisk and asterisks must be aligned
  • each asterisk must be followed by either a space or a newline (except for the first and the last)
  • the only characters before the asterisk on each line must be whitespace characters
  • one line comments must start with /** and end with */

As I see from your comment you had spacing issues.

查看更多
登录 后发表回答