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

Multiline blocks #733

Merged
merged 1 commit into from May 15, 2021
Merged

Multiline blocks #733

merged 1 commit into from May 15, 2021

Conversation

brettz9
Copy link
Collaborator

@brettz9 brettz9 commented May 15, 2021

Should fix the last of #199 whenever #727, #728, and #730 may be merged.

Builds on #727. You can review the diffs now or I can wait to rebase whenever that may be merged.

feat(multiline-blocks): allow control of how and whether jsdoc blocks can be expressed as single or multiple line blocks

…ks can be expressed as single or multiple line blocks
@brettz9 brettz9 merged commit 06bbf37 into gajus:master May 15, 2021
@brettz9 brettz9 deleted the multiline-blocks branch May 15, 2021 16:37
@gajus
Copy link
Owner

gajus commented May 15, 2021

🎉 This PR is included in version 34.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label May 15, 2021
@danvk
Copy link

danvk commented May 16, 2021

Thanks for accommodating my quirky JS Doc preferences with minimumLengthForMultiline @brettz9!

One issue I noticed is that setting noMultilineBlocks seems to disable noZeroLineText.

For example, this comment:

/** This comment is bad
 * It should not have text on line zero.
 */

is allowed with:

{
  noZeroLineText: true,
  noMultilineBlocks: true,
  minimumLengthForMultiline: 50
}

but with just:

{ noZeroLineText: true }

it's an error:

Should have no text on the "0th" line (after the `/**`). eslintjsdoc/multiline-blocks

The documentation hints at an interaction here ("noZeroLineText: noMultilineBlocks will have priority over this rule if it applies.") but I don't see what the connection is. I'd like to enforce that, if a JS Doc comment uses the multiline form because of its length, then it should have no text on line zero. The text should all be on lines 1, 2, etc.

@brettz9
Copy link
Collaborator Author

brettz9 commented May 16, 2021

@danvk : I hope to take a look at this maybe tomorrow or as I have energy, but could you add this as a separate issue? It's no bother to have a separate issue filed and linking back to the issue with a new one better ensures the concern won't be dropped. Thanks!

@brettz9
Copy link
Collaborator Author

brettz9 commented May 16, 2021

(However, you might clarify your comments there because it sounds like your statement "setting noMultilineBlocks seems to disable noZeroLineText" contradicts what your example shows.)

Nevermind, I follow you now. :-)

@danvk
Copy link

danvk commented May 16, 2021

Sure thing @brettz9, filed #737

Thanks for tackling all these issues! Your work is greatly appreciated.

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

Successfully merging this pull request may close these issues.

None yet

3 participants