-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
jsdoc/check-line-alignment option to take into account existing alignment #732
Comments
@renatho : Just pinging you (given your related work) in case you might have the inclination to implement. |
Hey there! I wonder about a case like this, for example: /**
* Description
*
* @param {object} options The user's options
* @param {string} message The text to be logged
* @param {object} error Optional object with additional details
*/ What would be the correct line? Maybe we could add a new option that would be the size of the spacings. If we set it to /**
* Description
*
* @param {object} options The user's options
* @param {string} message The text to be logged
* @param {object} error Optional object with additional details
*/ Would it work for you @TheJaredWilcurt? |
Yeah, I went ahead and set the current tests to accept the lines at the beginning of the block as they are. Of course, if we implement the said feature, then indeed that sounds like a good solution to me (and also suggests the problematic line number if you were able to implement that also). |
I guess I should explain my reasoning for the spaces. Between /**
* Description
*
* @param {object} error Text
*/
/**
* Description
*
* @param {object} name Text
* @return {obect} Text
*/ It's just easier to copy/paste common I never put more than one space between /**
* Description
*
* @param {object} error Text
*/
/**
* Description
*
* @param {object} name Text
* @param {boolean} bool Text
*/ I always use two spaces between the variable name and description, because it's just plain text and can visually get blurred with each other. This is why I was requesting the rule just check to see if each section starts at the same point in the line. But I was just thinking of it from a detection standpoint. I think your proposal was from an auto-fix standpoint. So I don't think it would be worth it to try to have some magic logic around the "2 spaces after tag if no return, or 1 if there is". As long as the linter can auto-fix the spacing after the tag, I'd be fine with it just being set to a number. But could we get greater granularity, like a option like this: {
// @param {string}
afterTag: 1
// {string} name
afterVariableType: 1
// name Text
afterVariableName: 2
} |
Sure. And isn't it remarkable how much we all love our little jsdoc zen gardens enough to have these feelings of proportion and beauty about it? :-) Thankfully with As far as "2 spaces after tag if no return, or 1 if there is", this is actually not a problem for us because we already have a concept--not through I like your object proposal, though for simplicity (and consistency with {
postDelimiter: 1, // After the asterisk
// @param {string}
postTag: 1
// {string} name
postType: 1
// name Text
postName: 2
} |
Hey folks! I added a PR for that! |
`customSpacings` option: ```js customSpacings: { postDelimiter: 2, postTag: 3, postType: 2, postName: 3, }, ``` If the spacing is not defined, it uses 1 by default. Co-authored-by: Renatho De Carli Rosa <[email protected]> Co-authored-by: Brett Zamir <[email protected]>
🎉 This issue has been resolved in version 34.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
With my current settings, the linter wants to change my alignment from this
to this
It should be able to detect that each section is starting at the same point on each line.
The text was updated successfully, but these errors were encountered: