Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected JSDoc block to be aligned. jsdoc/check-alignment #368

Closed
OmgImAlexis opened this issue Aug 22, 2019 · 8 comments
Closed

Expected JSDoc block to be aligned. jsdoc/check-alignment #368

OmgImAlexis opened this issue Aug 22, 2019 · 8 comments

Comments

@OmgImAlexis
Copy link
Contributor

The first returns a warning. The second is what was returned from --fix. The example I'm using is from the examples on jsdoc/check-alignment.

  ⚠  8:0  Expected JSDoc block to be aligned.  jsdoc/check-alignment

  1 warning
module.exports = function (si) {
	/**
      * Desc
      *
      * @param {number} foo
      */
     function quux(foo) {
     }
};
module.exports = function(si) {
	/**
  * Desc
  *
  * @param {number} foo
  */
	function quux(foo) {
	}
};
@golopot
Copy link
Collaborator

golopot commented Aug 22, 2019

Looks like the rule does not handle tab indents properly.

@brettz9
Copy link
Collaborator

brettz9 commented Oct 29, 2019

Fixed by #412

Note, however, that the fix is (including the approach before the recent fix) based on the assumption that the initial line is the one with the correct indentation. So in your case, the fixed code will look like:

module.exports = function (si) {
	/**
	 * Desc
	 *
	 * @param {number} foo
	 */
     function quux(foo) {
     }
};

If you wanted to see the indent instead made relative to the function or other context it is preceding, a new issue could be filed.

@brettz9 brettz9 closed this as completed Oct 29, 2019
@OmgImAlexis
Copy link
Contributor Author

@brettz9 a new issue would be a great idea. Would you mind opening it?

@brettz9
Copy link
Collaborator

brettz9 commented Oct 29, 2019

I have filed #413 . In the future, please file yourself so you can be automatically subscribed to the issues and can state the concern as you see it.

To subscribe to that issue without needing to add any comments, you can click Github's "Subscribe" button on the page for #413 on the right-hand side of the page.

Thanks for the report!

@OmgImAlexis
Copy link
Contributor Author

You don’t need to treat me like an idiot. I know how to use Github. I was on my phone when I saw the notification that’s all. 💁‍♀️

@brettz9
Copy link
Collaborator

brettz9 commented Oct 29, 2019

I didn't know about the Subscribe button last year or so despite being on Github for years! But then again, I may be idiot, so I wouldn't know how to treat others otherwise. :)

@brettz9
Copy link
Collaborator

brettz9 commented Oct 29, 2019

And FWIW, as a former teacher, I tend to overexplain things to everyone in the event not only that the immediate listener doesn't happen to know but also in case others coming across the issue don't either, so even if I do state something seemingly obvious, please don't take it as being directed at you.

@GuangTom
Copy link

GuangTom commented Oct 9, 2022

And FWIW, as a former teacher, I tend to overexplain things to everyone in the event not only that the immediate listener doesn't happen to know but also in case others coming across the issue don't either, so even if I do state something seemingly obvious, please don't take it as being directed at you.

You don't need to apologize, you are doing a right thing, my friend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants